mirror of
https://github.com/raysan5/raygui.git
synced 2026-01-31 03:09:17 -05:00
Update README.md
This commit is contained in:
38
README.md
38
README.md
@ -25,6 +25,44 @@
|
|||||||
- **Icons support**, embedding a complete 1-bit icons pack
|
- **Icons support**, embedding a complete 1-bit icons pack
|
||||||
- Multiple **tools** provided for raygui development
|
- Multiple **tools** provided for raygui development
|
||||||
|
|
||||||
|
## code sample
|
||||||
|
```c
|
||||||
|
#include "raylib.h"
|
||||||
|
|
||||||
|
#define RAYGUI_IMPLEMENTATION
|
||||||
|
#include "raygui.h"
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
InitWindow(400, 200, "raygui - controls test suite");
|
||||||
|
SetTargetFPS(60);
|
||||||
|
|
||||||
|
bool showMessageBox = false;
|
||||||
|
|
||||||
|
while (!WindowShouldClose())
|
||||||
|
{
|
||||||
|
// Draw
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
BeginDrawing();
|
||||||
|
ClearBackground(GetColor(GuiGetStyle(DEFAULT, BACKGROUND_COLOR)));
|
||||||
|
|
||||||
|
if (GuiButton((Rectangle){ 24, 24, 120, 30 }, "#191#Show Message")) showMessageBox = true;
|
||||||
|
|
||||||
|
if (showMessageBox)
|
||||||
|
{
|
||||||
|
int result = GuiMessageBox((Rectangle){ 85, 70, 250, 100 }, "#191#Message Box", "Hi! This is a message!", "Nice;Cool");
|
||||||
|
if (result >= 0) showMessageBox = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
EndDrawing();
|
||||||
|
}
|
||||||
|
|
||||||
|
CloseWindow();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
```
|
||||||
|

|
||||||
|
|
||||||
## raygui controls
|
## raygui controls
|
||||||
|
|
||||||
### basic controls
|
### basic controls
|
||||||
|
|||||||
Reference in New Issue
Block a user