Super-simple raylib GUI library for people who don't want to mess with colors, positions, margins, styles, icons, anchors, and many other shenanigans which are unnecessary for the functionality of a GUI.
It arranges all widgets in a dynamic column with all of those aforementioned things already handled.
- Auto-scaling based on window/screen height
- Automatically chooses between centering and scrolling based on total vertical size of all added widgets relative to window/screen height
- One-line widget adding
- Gap
- Label
- Button
- Checkbox
- InputField
- ...possibly more to come...
Between raylib's BeginDrawing()
& EndDrawing()
:
- Assemble UI by calling related widget functions (Ex.:
RaySimpleGUI__Button("Button text", &CallbackFunction)
) - Call
RaySimpleGUI__Draw()
#include <stdio.h>
#include "raylib/raylib.h"
#include "RaySimpleGUI.h"
void ExampleCallback() {
puts("Click!");
}
int bCheckboxState = 1;
char inputFieldData[64];
int main() {
InitWindow(1280, 720, 0);
while (!WindowShouldClose()) {
BeginDrawing();
RaySimpleGUI__Label("EXAMPLE LABEL");
RaySimpleGUI__Gap();
RaySimpleGUI__Button("EXAMPLE BUTTON", &ExampleCallback);
RaySimpleGUI__Checkbox(&bCheckboxState);
RaySimpleGUI__InputField(inputFieldData, 64);
RaySimpleGUI__Draw();
EndDrawing();
}
printf("\nLast checkbox state: %d\n", bCheckboxState);
printf("\nInput field data: %s\n", inputFieldData);
return 0;
}