KroysUiApi
Colors are packed RGBA8: r | g << 8 | b << 16 | a << 24. Icons are Lucide names ("plug", "play", "folder", "box", "settings", ...); unknown names draw the plug icon. Labels may use "##id" suffixes to keep ids unique. Every function returns a "changed/clicked" flag where it has one.
Declaration
Declared in kroys/kroys_plugin.h.
kroys_plugin.h
typedef struct KroysUiApi { ... } KroysUiApi;
Members
#uint32_t structSize;Size of this struct as the writer compiled it (sizeof); the reader uses it to detect members appended by later minor versions.
#uint32_t reserved;Padding reserved for later use; leave it 0.
#void (KROYS_CALL* Text)(KroysContext context, const char* text);A line of text.
#void (KROYS_CALL* TextWrapped)(KroysContext context, const char* text);Text wrapped at the panel width.
#void (KROYS_CALL* TextColored)(KroysContext context, int32_t color, const char* text);Text in a theme colour (KroysThemeColor).
#void (KROYS_CALL* Heading)(KroysContext context, const char* text);A heading (larger, bold).
#void (KROYS_CALL* Icon)(KroysContext context, const char* iconName);A Lucide icon by name.
#int32_t (KROYS_CALL* Button)(KroysContext context, const char* label, uint32_t flags);A button (KROYS_UI_BUTTON_* flags); nonzero when clicked.
#int32_t (KROYS_CALL* IconButton)(KroysContext context, const char* id, const char* iconName, const char* tooltip);An icon button with a tooltip; nonzero when clicked.
#int32_t (KROYS_CALL* Checkbox)(KroysContext context, const char* label, int32_t* value);A checkbox editing *value (0 or 1); nonzero when toggled.
#int32_t (KROYS_CALL* InputText)(KroysContext context, const char* label, char* buffer, uint32_t capacity, uint32_t flags);A text field editing the plugin's buffer (capacity bytes including the terminator; KROYS_UI_INPUT_* flags); nonzero when changed.
#int32_t (KROYS_CALL* InputInt)(KroysContext context, const char* label, int32_t* value);An integer field; nonzero when changed.
#int32_t (KROYS_CALL* InputFloat)(KroysContext context, const char* label, float* value);A float field; nonzero when changed.
#int32_t (KROYS_CALL* SliderFloat)(KroysContext context, const char* label, float* value, float minimum, float maximum);A slider from minimum to maximum; nonzero when changed.
#int32_t (KROYS_CALL* DragFloat3)(KroysContext context, const char* label, float* values, float speed);Three drag fields editing values[3] (a vector); nonzero when changed.
#int32_t (KROYS_CALL* Combo)(KroysContext context, const char* label, int32_t* index, const char* const* items, uint32_t itemCount);A dropdown over items editing *index; nonzero when the selection changed.
#int32_t (KROYS_CALL* Selectable)(KroysContext context, const char* label, int32_t selected);A selectable row; nonzero when clicked.
#void (KROYS_CALL* SameLine)(KroysContext context);The next item stays on this line.
#void (KROYS_CALL* Spacing)(KroysContext context);Vertical space.
#void (KROYS_CALL* Separator)(KroysContext context);A horizontal line.
#void (KROYS_CALL* SeparatorText)(KroysContext context, const char* text);A horizontal line with a caption.
#void (KROYS_CALL* Indent)(KroysContext context);Indents the following items.
#void (KROYS_CALL* Unindent)(KroysContext context);Ends an Indent.
#void (KROYS_CALL* SetNextItemWidth)(KroysContext context, float width);Width of the next item, in pixels.
#float (KROYS_CALL* AvailableWidth)(KroysContext context);Remaining width on the current line, in pixels.
#void (KROYS_CALL* BeginDisabled)(KroysContext context, int32_t disabled);Starts a block drawn disabled when disabled is nonzero; always end it with EndDisabled.
#void (KROYS_CALL* EndDisabled)(KroysContext context);Ends a BeginDisabled block.
#void (KROYS_CALL* PushId)(KroysContext context, const char* id);Pushes an id scope (repeated widgets with the same labels).
#void (KROYS_CALL* PopId)(KroysContext context);Pops an id scope.
#int32_t (KROYS_CALL* BeginSection)(KroysContext context, const char* label, uint32_t flags);Collapsible section; call EndSection only when it returned nonzero.
#void (KROYS_CALL* EndSection)(KroysContext context);Ends a section.
#int32_t (KROYS_CALL* BeginTable)(KroysContext context, const char* id, uint32_t columns, uint32_t flags);Call EndTable only when BeginTable returned nonzero.
#void (KROYS_CALL* TableSetupColumn)(KroysContext context, const char* label, float width);Declares the next column (width 0: stretch).
#void (KROYS_CALL* TableHeadersRow)(KroysContext context);Draws the header row of the declared columns.
#void (KROYS_CALL* TableNextRow)(KroysContext context);Starts a row.
#int32_t (KROYS_CALL* TableNextColumn)(KroysContext context);Moves to the next cell; nonzero when it is visible.
#void (KROYS_CALL* EndTable)(KroysContext context);Ends a table.
#int32_t (KROYS_CALL* TreeNode)(KroysContext context, const char* label, uint32_t flags);Call TreePop only when TreeNode returned nonzero (and the node is not a leaf).
#void (KROYS_CALL* TreePop)(KroysContext context);Closes a tree node.
#void (KROYS_CALL* Tooltip)(KroysContext context, const char* text);Tooltip of the previous item (shown while hovered).
#int32_t (KROYS_CALL* IsItemHovered)(KroysContext context);Nonzero when the previous item is hovered.
#int32_t (KROYS_CALL* IsItemClicked)(KroysContext context);Nonzero when the previous item was clicked.
#uint32_t (KROYS_CALL* ThemeColor)(KroysContext context, int32_t color);A theme colour (KroysThemeColor), packed RGBA8.
#float (KROYS_CALL* ThemeMetric)(KroysContext context, int32_t metric);A theme metric (KroysThemeMetric) in pixels (KROYS_METRIC_UI_SCALE: a factor).
#void (KROYS_CALL* ProgressBar)(KroysContext context, float fraction, const char* overlay);A progress bar (fraction 0..1) with an optional overlay text.
#int32_t (KROYS_CALL* ColorEdit4)(KroysContext context, const char* label, float* rgba);An RGBA colour editor (rgba[4], 0..1); nonzero when changed.
Members
uint32_t structSize; uint32_t reserved; void (KROYS_CALL* Text)(KroysContext context, const char* text); void (KROYS_CALL* TextWrapped)(KroysContext context, const char* text); void (KROYS_CALL* TextColored)(KroysContext context, int32_t color, const char* text); void (KROYS_CALL* Heading)(KroysContext context, const char* text); void (KROYS_CALL* Icon)(KroysContext context, const char* iconName); int32_t (KROYS_CALL* Button)(KroysContext context, const char* label, uint32_t flags); int32_t (KROYS_CALL* IconButton)(KroysContext context, const char* id, const char* iconName, const char* tooltip); int32_t (KROYS_CALL* Checkbox)(KroysContext context, const char* label, int32_t* value); int32_t (KROYS_CALL* InputText)(KroysContext context, const char* label, char* buffer, uint32_t capacity, uint32_t flags); int32_t (KROYS_CALL* InputInt)(KroysContext context, const char* label, int32_t* value); int32_t (KROYS_CALL* InputFloat)(KroysContext context, const char* label, float* value); int32_t (KROYS_CALL* SliderFloat)(KroysContext context, const char* label, float* value, float minimum, float maximum); int32_t (KROYS_CALL* DragFloat3)(KroysContext context, const char* label, float* values, float speed); int32_t (KROYS_CALL* Combo)(KroysContext context, const char* label, int32_t* index, const char* const* items, uint32_t itemCount); int32_t (KROYS_CALL* Selectable)(KroysContext context, const char* label, int32_t selected); void (KROYS_CALL* SameLine)(KroysContext context); void (KROYS_CALL* Spacing)(KroysContext context); void (KROYS_CALL* Separator)(KroysContext context); void (KROYS_CALL* SeparatorText)(KroysContext context, const char* text); void (KROYS_CALL* Indent)(KroysContext context); void (KROYS_CALL* Unindent)(KroysContext context); void (KROYS_CALL* SetNextItemWidth)(KroysContext context, float width); float (KROYS_CALL* AvailableWidth)(KroysContext context); void (KROYS_CALL* BeginDisabled)(KroysContext context, int32_t disabled); void (KROYS_CALL* EndDisabled)(KroysContext context); void (KROYS_CALL* PushId)(KroysContext context, const char* id); void (KROYS_CALL* PopId)(KroysContext context); int32_t (KROYS_CALL* BeginSection)(KroysContext context, const char* label, uint32_t flags); void (KROYS_CALL* EndSection)(KroysContext context); int32_t (KROYS_CALL* BeginTable)(KroysContext context, const char* id, uint32_t columns, uint32_t flags); void (KROYS_CALL* TableSetupColumn)(KroysContext context, const char* label, float width); void (KROYS_CALL* TableHeadersRow)(KroysContext context); void (KROYS_CALL* TableNextRow)(KroysContext context); int32_t (KROYS_CALL* TableNextColumn)(KroysContext context); void (KROYS_CALL* EndTable)(KroysContext context); int32_t (KROYS_CALL* TreeNode)(KroysContext context, const char* label, uint32_t flags); void (KROYS_CALL* TreePop)(KroysContext context); void (KROYS_CALL* Tooltip)(KroysContext context, const char* text); int32_t (KROYS_CALL* IsItemHovered)(KroysContext context); int32_t (KROYS_CALL* IsItemClicked)(KroysContext context); uint32_t (KROYS_CALL* ThemeColor)(KroysContext context, int32_t color); float (KROYS_CALL* ThemeMetric)(KroysContext context, int32_t metric); void (KROYS_CALL* ProgressBar)(KroysContext context, float fraction, const char* overlay); int32_t (KROYS_CALL* ColorEdit4)(KroysContext context, const char* label, float* rgba);
KroysEngine 0.1.0 documentation, built from the engine repository by Tools/BuildDocsSite.py.