← ziglang.inraylib-zigGitHub

raygui

Immediate-mode GUI controls (as @import("raygui")). 61 functions, from raylib's raygui.

Global gui state control functions

gui.isLocked

Check if gui is locked (global state)

Zigfn isLocked() bool
Cbool GuiIsLocked(void);

gui.setAlpha

Set gui controls alpha (global state), alpha goes from 0.0f to 1.0f

Zigfn setAlpha(alpha: f32) void
Cvoid GuiSetAlpha(float alpha);

gui.getState

Get gui state (global state)

Zigfn getState() State
Cint GuiGetState(void);

Font set/get functions

gui.setFont

Set gui custom font (global state)

Zigfn setFont(font: Font) void
Cvoid GuiSetFont(Font font);

Style set/get functions

gui.getStyle

Get one style property

Zigfn getStyle(control: Control, property: anytype) i32
Cint GuiGetStyle(int control, int property);

Styles loading functions

gui.loadStyle

Load style file over global style variable (.rgs)

Zigfn loadStyle(fileName: ?[:0]const u8) void
Cvoid GuiLoadStyle(const char *fileName);

gui.loadStyleFromMemory

Load style from memory (binary only)

Zigfn loadStyleFromMemory(fileData: []const u8) void
Cvoid GuiLoadStyleFromMemory(const unsigned char *fileData, int dataSize);

gui.loadStyleDefault

Load style default over global style

Zigfn loadStyleDefault() void
Cvoid GuiLoadStyleDefault(void);

Tooltips management functions

gui.enableTooltip

Enable gui tooltips (global state)

Zigfn enableTooltip() void
Cvoid GuiEnableTooltip(void);

gui.disableTooltip

Disable gui tooltips (global state)

Zigfn disableTooltip() void
Cvoid GuiDisableTooltip(void);

gui.setTooltip

Set tooltip string

Zigfn setTooltip(tooltip: ?[:0]const u8) void
Cvoid GuiSetTooltip(const char *tooltip);

Icons functionality

gui.iconText

Get text with icon id prepended (if supported)

Zigfn iconText(iconId: IconName, text: ?[:0]const u8) [:0]const u8
Cconst char *GuiIconText(int iconId, const char *text);

gui.getIcons

Get raygui icons data pointer

Zigfn getIcons() [*]u32
Cunsigned int *GuiGetIcons(void);

gui.loadIcons

Load raygui icons file (.rgi) into internal icons data

Zigfn loadIcons(fileName: ?[:0]const u8, loadIconsName: bool) ?[*][*:0]u8
Cchar **GuiLoadIcons(const char *fileName, bool loadIconsName);

gui.loadIconsFromMemory

Load raygui icons file (.rgi) from memory into internal icons data

Zigfn loadIconsFromMemory(fileData: []const u8, loadIconsName: bool) ?[*][*:0]u8
Cchar **GuiLoadIconsFromMemory(const unsigned char *fileData, int dataSize, bool loadIconsName);

gui.drawIcon

Draw icon using pixel size at specified position

Zigfn drawIcon(iconId: IconName, posX: i32, posY: i32, pixelSize: i32, color: Color) void
Cvoid GuiDrawIcon(int iconId, int posX, int posY, int pixelSize, Color color);

Utility functions

gui.getTextWidth

Get text width considering gui style and icon size (if required)

Zigfn getTextWidth(text: ?[:0]const u8) i32
Cint GuiGetTextWidth(const char *text);

Container/separator controls, useful for controls organization

gui.windowBox

Window Box control, shows a window that can be closed

Zigfn windowBox(bounds: Rectangle, title: ?[:0]const u8) i32
Cint GuiWindowBox(Rectangle bounds, const char *title);

gui.line

Line separator control, could contain text

Zigfn line(bounds: Rectangle, text: ?[:0]const u8) i32
Cint GuiLine(Rectangle bounds, const char *text);

Used in shapes_pie_chart.

gui.panel

Panel control, useful to group controls

Zigfn panel(bounds: Rectangle, text: ?[:0]const u8) i32
Cint GuiPanel(Rectangle bounds, const char *text);

gui.scrollPanel

Scroll Panel control

Zigfn scrollPanel(bounds: Rectangle, text: ?[:0]const u8, content: Rectangle, scroll: *Vector2, view: *Rectangle) i32
Cint GuiScrollPanel(Rectangle bounds, const char *text, Rectangle content, Vector2 *scroll, Rectangle *view);

Used in shapes_pie_chart.

Basic controls set

gui.labelButton

Label button control, returns true when clicked

Zigfn labelButton(bounds: Rectangle, text: ?[:0]const u8) i32
Cint GuiLabelButton(Rectangle bounds, const char *text);

gui.toggleSlider

Toggle Slider control

Zigfn toggleSlider(bounds: Rectangle, text: ?[:0]const u8, active: *i32) i32
Cint GuiToggleSlider(Rectangle bounds, const char *text, int *active);

gui.comboBox

Combo Box control

Zigfn comboBox(bounds: Rectangle, text: ?[:0]const u8, active: *i32) i32
Cint GuiComboBox(Rectangle bounds, const char *text, int *active);

gui.spinner

Spinner control

Zigfn spinner(bounds: Rectangle, text: ?[:0]const u8, value: *i32, minValue: i32, maxValue: i32, editMode: bool) i32
Cint GuiSpinner(Rectangle bounds, const char *text, int *value, int minValue, int maxValue, bool editMode);

Used in shapes_pie_chart, shapes_hilbert_curve.

gui.valueBox

Value Box control, updates input text with numbers

Zigfn valueBox(bounds: Rectangle, text: ?[:0]const u8, value: *i32, minValue: i32, maxValue: i32, editMode: bool) i32
Cint GuiValueBox(Rectangle bounds, const char *text, int *value, int minValue, int maxValue, bool editMode);

gui.valueBoxFloat

Value box control for float values

Zigfn valueBoxFloat(bounds: Rectangle, text: ?[:0]const u8, textValue: [*]u8, value: *f32, editMode: bool) i32
Cint GuiValueBoxFloat(Rectangle bounds, const char *text, char *textValue, float *value, bool editMode);

gui.progressBar

Progress Bar control

Zigfn progressBar(bounds: Rectangle, textLeft: ?[:0]const u8, textRight: ?[:0]const u8, value: *f32, minValue: f32, maxValue: f32) i32
Cint GuiProgressBar(Rectangle bounds, const char *textLeft, const char *textRight, float *value, float minValue, float maxValue);

Used in models_animation_blending, models_animation_timing.

gui.statusBar

Status Bar control, shows info text

Zigfn statusBar(bounds: Rectangle, text: ?[:0]const u8) i32
Cint GuiStatusBar(Rectangle bounds, const char *text);

gui.dummyRec

Dummy control for placeholders

Zigfn dummyRec(bounds: Rectangle, text: ?[:0]const u8) i32
Cint GuiDummyRec(Rectangle bounds, const char *text);

gui.grid

Grid control

Zigfn grid(bounds: Rectangle, text: ?[:0]const u8, spacing: f32, subdivs: i32, mouseCell: *Vector2) i32
Cint GuiGrid(Rectangle bounds, const char *text, float spacing, int subdivs, Vector2 *mouseCell);

Advance controls set

gui.listView

List View control

Zigfn listView(bounds: Rectangle, text: ?[:0]const u8, scrollIndex: *i32, active: *i32) i32
Cint GuiListView(Rectangle bounds, const char *text, int *scrollIndex, int *active);

gui.listViewEx

List View control, using text entries list and returning focus entry

Zigfn listViewEx(bounds: Rectangle, text: []const [*:0]const u8, scrollIndex: *i32, active: *i32, focus: *i32) i32
Cint GuiListViewEx(Rectangle bounds, char **text, int count, int *scrollIndex, int *active, int *focus);

Used in core_directory_files.

gui.tabBar

Tab Bar control

Zigfn tabBar(bounds: Rectangle, text: ?[:0]const u8, hscroll: *i32, active: *i32) i32
Cint GuiTabBar(Rectangle bounds, const char *text, int *hscroll, int *active);

gui.tabBarEx

Tab Bar control, using text entries list and returning focus entry

Zigfn tabBarEx(bounds: Rectangle, text: []const [*:0]const u8, hscroll: *i32, active: *i32, focus: *i32) i32
Cint GuiTabBarEx(Rectangle bounds, char **text, int count, int *hscroll, int *active, int *focus);

gui.messageBox

Message Box control, displays a message

Zigfn messageBox(bounds: Rectangle, title: ?[:0]const u8, message: ?[:0]const u8, btnText: ?[:0]const u8, btnActive: *i32) i32
Cint GuiMessageBox(Rectangle bounds, const char *title, const char *message, const char *btnText, int *btnActive);

gui.textInputBox

Text Input Box control, ask for text, supports secret

Zigfn textInputBox(bounds: Rectangle, title: ?[:0]const u8, message: ?[:0]const u8, text: ?[]u8, btnText: ?[:0]const u8, btnActive: *i32, secretViewActive: *bool) i32
Cint GuiTextInputBox(Rectangle bounds, const char *title, const char *message, char *text, int textSize, const char *btnText, int *btnActive, bool *secretViewActive);

gui.colorPicker

Color Picker control, includes Color bar controls

Zigfn colorPicker(bounds: Rectangle, text: ?[:0]const u8, color: *Color) i32
Cint GuiColorPicker(Rectangle bounds, const char *text, Color *color);

gui.colorPanel

Color Panel control

Zigfn colorPanel(bounds: Rectangle, text: ?[:0]const u8, color: *Color) i32
Cint GuiColorPanel(Rectangle bounds, const char *text, Color *color);

gui.colorBarAlpha

Color Bar Alpha control

Zigfn colorBarAlpha(bounds: Rectangle, text: ?[:0]const u8, alpha: *f32) i32
Cint GuiColorBarAlpha(Rectangle bounds, const char *text, float *alpha);

gui.colorBarHue

Color Bar Hue control

Zigfn colorBarHue(bounds: Rectangle, text: ?[:0]const u8, value: *f32) i32
Cint GuiColorBarHue(Rectangle bounds, const char *text, float *value);

gui.colorPickerHSV

Color Picker control, using Hue-Saturation-Value color data, includes Color bar controls

Zigfn colorPickerHSV(bounds: Rectangle, text: ?[:0]const u8, colorHsv: *Vector3) i32
Cint GuiColorPickerHSV(Rectangle bounds, const char *text, Vector3 *colorHsv);

gui.colorPanelHSV

Color Panel control, using Hue-Saturation-Value color data

Zigfn colorPanelHSV(bounds: Rectangle, text: ?[:0]const u8, colorHsv: *Vector3) i32
Cint GuiColorPanelHSV(Rectangle bounds, const char *text, Vector3 *colorHsv);