14 Commits

Author SHA1 Message Date
Ray
020a61bebc Updated README.md 2026-07-21 00:04:37 +02:00
Ray
13896112c9 Update README.md 2026-07-21 00:01:05 +02:00
Ray
94758e173f Updated README 2026-07-20 23:59:49 +02:00
Ray
d2caa22edd Update raygui.h 2026-07-20 23:59:24 +02:00
Ray
fb43fd8299 Merge branch 'master' of https://github.com/raysan5/raygui 2026-07-20 23:47:05 +02:00
Ray
090728006d Update README.md icons image 2026-07-20 23:46:55 +02:00
Ray
fa380d83e8 Update README.md 2026-07-20 23:41:08 +02:00
Ray
13d85f1023 Update README.md 2026-07-20 23:39:49 +02:00
e95df4778d Change icon ID in README.md example (#566)
Updated the prefix from the old RICON to ICON
2026-07-20 23:35:06 +02:00
Ray
37b864af90 Update raygui.h 2026-07-20 23:34:37 +02:00
Ray
0e1bc2b2ad REPLACED: DrawRectangleGradientV() by DrawRectangleGradientEx() 2026-07-20 21:08:09 +02:00
Ray
00f68c3248 Update raygui.h 2026-07-20 20:47:58 +02:00
Ray
437adee05d Update raygui.h 2026-07-20 20:35:42 +02:00
Ray
14cb4c4c05 ADDED: Functions return result value, consistent between functions
REDESIGNED: WARNING: GuiMessageBox(), added parameter for btn return, unify result
REDESIGNED. WARNING: GuiTextInputBox(), added parameter for btn return, unify result
2026-07-20 19:50:51 +02:00
8 changed files with 297 additions and 155 deletions

View File

@ -10,9 +10,9 @@
<br>
**WARNING: Latest `raygui` from master branch is always aligned with latest `raylib` from master branch. Make sure to use the appropriate versions.**
**WARNING: Latest `raygui` from master branch is always aligned with latest `raylib` from master branch and all raylibtech tools. Make sure to use the appropriate versions.**
**WARNING: Latest `raygui 4.0` is an API-BREAKING redesign from previous versions (3.x), now all functions are more consistent and coherent, you can read the details about this breaking change in issue [283](https://github.com/raysan5/raygui/issues/283)**
**WARNING: Latest `raygui 5.0` introduces some API-BREAKING changes, now all functions return a result value.**
*NOTE: raygui is a single-file header-only library (despite its internal dependency on raylib), so, functions definition AND implementation reside in the same file `raygui.h`, when including `raygui.h` in a module, `RAYGUI_IMPLEMENTATION` must be previously defined to include the implementation part of `raygui.h` BUT only in one compilation unit, other modules could also include `raygui.h` but `RAYGUI_IMPLEMENTATION` must not be defined again.*
@ -50,10 +50,11 @@ int main()
if (showMessageBox)
{
int result = GuiMessageBox((Rectangle){ 85, 70, 250, 100 },
"#191#Message Box", "Hi! This is a message!", "Nice;Cool");
int btnActive = -1;
GuiMessageBox((Rectangle){ 85, 70, 250, 100 },
"#191#Message Box", "Hi! This is a message!", "Nice;Cool", &btnActive);
if (result >= 0) showMessageBox = false;
if (btnActive >= 0) showMessageBox = false;
}
EndDrawing();
@ -99,9 +100,9 @@ Styles can be loaded at runtime using raygui `GuiLoadStyle()` function. Simple a
## raygui icons
`raygui` supports custom icons, by default, a predefined set of icons is provided inside `raygui` as an array of binary data; it contains **256 possible icons** defined as **16x16 pixels** each; each pixel is codified using **1-bit**. The total size of the array is `2048 bytes`.
`raygui` supports custom icons, by default, a predefined set of icons is provided inside `raygui` as an array of binary data; it contains **512 possible icons** defined as **16x16 pixels** each; each pixel is codified using **1-bit**. The total size of the array is `4096 bytes`.
<img align="right" src="images/raygui_ricons.png">
![raygui icons v5](images/raygui_icons_v5.png)
To use any of those icons just prefix the *#iconId#* number to **any text** written within `raygui` controls:
```c
@ -109,7 +110,7 @@ if (GuiButton(rec, "#05#Open Image")) { /* ACTION */ }
```
It's also possible to use the provided `GuiIconText()` function to prefix it automatically, using a clearer identifier (defined in `raygui.h`).
```c
if (GuiButton(rec, GuiIconText(RICON_FILE_OPEN, "Open Image"))) { /* ACTION */ }
if (GuiButton(rec, GuiIconText(ICON_FILE_OPEN, "Open Image"))) { /* ACTION */ }
```
Provided set of icons can be reviewed and customized using [rGuiIcons](https://raylibtech.itch.io/rguiicons) tool.
@ -117,15 +118,15 @@ Provided set of icons can be reviewed and customized using [rGuiIcons](https://r
- [**rGuiStyler**](https://raylibtech.itch.io/rguistyler) - A simple and easy-to-use raygui styles editor.
![rGuiStyler v3.1](images/rguistyler_v300.png)
![rGuiStyler v6.0](images/rguistyler_v600.png)
- [**rGuiIcons**](https://raylibtech.itch.io/rguiicons) - A simple and easy-to-use raygui icons editor.
![rGuiIcons v1.0](images/rguiicons_v100.png)
![rGuiIcons v4.0](images/rguiicons_v400.png)
- [**rGuiLayout**](https://raylibtech.itch.io/rguilayout) - A simple and easy-to-use raygui layouts editor.
![rGuiLayout v2.2](images/rguilayout_v220.png)
![rGuiLayout v5.0](images/rguilayout_v500.png)
## building

View File

@ -305,10 +305,12 @@ int main()
if (showMessageBox)
{
DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), Fade(RAYWHITE, 0.8f));
int result = GuiMessageBox((Rectangle){ (float)GetScreenWidth()/2 - 125, (float)GetScreenHeight()/2 - 50, 250, 100 }, GuiIconText(ICON_EXIT, "Close Window"), "Do you really want to exit?", "Yes;No");
int btnActive = -1;
GuiMessageBox((Rectangle){ (float)GetScreenWidth()/2 - 125, (float)GetScreenHeight()/2 - 50, 250, 100 },
GuiIconText(ICON_EXIT, "Close Window"), "Do you really want to exit?", "Yes;No", &btnActive);
if ((result == 0) || (result == 2)) showMessageBox = false;
else if (result == 1) exitWindow = true;
if ((btnActive == 0) || (btnActive == 2)) showMessageBox = false;
else if (btnActive == 1) exitWindow = true;
}
if (showTextInputBox)
@ -316,16 +318,18 @@ int main()
GuiUnlock();
DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), Fade(RAYWHITE, 0.8f));
int result = GuiTextInputBox((Rectangle){ (float)GetScreenWidth()/2 - 120, (float)GetScreenHeight()/2 - 60, 240, 140 }, GuiIconText(ICON_FILE_SAVE, "Save file as..."), "Introduce output file name:", "Ok;Cancel", textInput, 255, NULL);
int btnActive = -1;
GuiTextInputBox((Rectangle){ (float)GetScreenWidth()/2 - 120, (float)GetScreenHeight()/2 - 60, 240, 140 },
GuiIconText(ICON_FILE_SAVE, "Save file as..."), "Introduce output file name:", textInput, 255, "Ok;Cancel", &btnActive, NULL);
if (result == 1)
if (btnActive == 1)
{
// TODO: Validate textInput value and save
TextCopy(textInputFileName, textInput);
}
if ((result == 0) || (result == 1) || (result == 2))
if ((btnActive == 0) || (btnActive == 1) || (btnActive == 2))
{
showTextInputBox = false;
TextCopy(textInput, "\0");

View File

Before

Width:  |  Height:  |  Size: 6.8 KiB

After

Width:  |  Height:  |  Size: 6.8 KiB

BIN
images/raygui_icons_v5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

BIN
images/rguiicons_v400.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

BIN
images/rguilayout_v500.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

BIN
images/rguistyler_v600.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 KiB

File diff suppressed because it is too large Load Diff