add raygui example
This commit is contained in:
35
main.c
35
main.c
@@ -1,7 +1,40 @@
|
||||
#include <stdio.h>
|
||||
|
||||
#include "raylib.h"
|
||||
#define RAYGUI_IMPLEMENTATION
|
||||
#include "raygui.h"
|
||||
|
||||
int main(void) {
|
||||
printf("Hello\n");
|
||||
InitWindow(400, 200, "App");
|
||||
SetTargetFPS(60);
|
||||
|
||||
bool showMessageBox = false;
|
||||
|
||||
while (!WindowShouldClose()) {
|
||||
BeginDrawing();
|
||||
ClearBackground(GetColor(GuiGetStyle(DEFAULT, BACKGROUND_COLOR)));
|
||||
|
||||
if (GuiButton((Rectangle){24, 24, 120, 30}, "#191Show Message")) {
|
||||
showMessageBox = true;
|
||||
}
|
||||
|
||||
if (showMessageBox) {
|
||||
int result = GuiMessageBox(
|
||||
(Rectangle){85, 70, 250, 100},
|
||||
"#191Message Box",
|
||||
"Hi! This is a message!",
|
||||
"Nice;Cool"
|
||||
);
|
||||
|
||||
if (result >= 0) {
|
||||
showMessageBox = false;
|
||||
}
|
||||
}
|
||||
|
||||
EndDrawing();
|
||||
}
|
||||
|
||||
CloseWindow();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user