A tiny, portable, immediate-mode UI library ported to Go (as of commit 0850aba860959c3e75fb3e97120ca92957f9d057, v2.02)
-
Functions and structs are renamed to be PascalCase and the prefix
mu_is removed, like this:mu_push_command->PushCommandmu_begin_treenode_ex->BeginTreeNodeExmu_get_clip_rect->GetClipRect -
Every function that takes
mu_Context(Context) instead has aContextreciever, soButton(ctx, label)becomesctx.Button(label) -
Stacks are now slices with variable length,
appendis used forpushandslice = slice[:len(slice)-1]is used forpop -
mu_Font(Font) isinterface{}, since it doesn't store any font data. You can usereflectif you want to store values inside it -
All pointer-based commands (
MU_COMMAND_JUMP) and theCommandstruct have been reworked to use indices -
The
mu_Realtype has been replaced withfloat32because Go does not allow implicit casting of identical type aliases -
The library is split into separate files instead of one file
-
The library is ~1300 lines of code in total
NewContext, which is a helper for creating a newContextctx.Render, which calls a function for every command inside the command list, then clears it
- Ebitengine rendering backend + demo port: zeozeozeo/ebitengine-microui-go
- Official Ebitengine fork and integration efforts: ebitengine/microui
The library expects the user to provide input and handle the resultant drawing commands, it does not do any drawing/tessellation itself.
Thank you @rxi for creating this awesome library and thank you @Zyko0 for contributing numerous fixes to this Go port.