Angluca/sokol-zig-microui-example
microui, a tiny immediate-mode ui library
e0df69dc8ca17053bfa48ecec46dde02acb4395b
A tiny, portable, immediate-mode UI library written in Zig rxi/microui
1100 sloc
of ANSI Cif (cc.mu_begin_window(ctx, "My Window", mu_rect(10, 10, 140, 86)) != 0) {
cc.mu_layout_row(ctx, 2, &[_]i32{ 60, -1 }, 0);
cc.mu_label(ctx, "First:");
if (mu_button(ctx, "Button1") != 0) {
std.debug.print("Button1 pressed\n", .{});
}
cc.mu_label(ctx, "Second:");
if (cc.mu_button(ctx, "Button2") != 0) {
cc.mu_open_popup(ctx, "My Popup");
}
if (cc.mu_begin_popup(ctx, "My Popup") != 0) {
cc.mu_label(ctx, "Hello world!");
cc.mu_end_popup(ctx);
}
cc.mu_end_window(ctx);
}
doc/usage.md
for usage instructionsdemo
directory for a usage exampleThe library expects the user to provide input and handle the resultant drawing commands, it does not do any drawing itself.
The library is designed to be lightweight, providing a foundation to which you can easily add custom controls and UI elements; pull requests adding additional features will likely not be merged. Bug reports are welcome.
This library is free software; you can redistribute it and/or modify it under the terms of the MIT license. See LICENSE for details.