raygui/README.md

81 lines
3.6 KiB
Markdown
Raw Normal View History

2018-02-12 12:20:15 +01:00
<img align="left" src="logo/raygui_256x256.png" width=256>
2017-07-02 13:37:07 +02:00
2019-04-29 10:13:36 +02:00
**raygui** is a simple and easy-to-use immediate-mode-gui library.
2016-09-07 18:25:06 +02:00
2018-07-21 13:47:07 +02:00
raygui was initially inspired by [Unity IMGUI](https://docs.unity3d.com/Manual/GUIScriptingGuide.html) (immediate mode GUI API).
2016-09-07 18:25:06 +02:00
2020-02-10 16:58:44 +01:00
raygui was originated as an auxiliar module for [raylib](https://github.com/raysan5/raylib) to create simple GUI interfaces using raylib graphic style (simple colors, plain rectangular shapes, wide borders...).
2017-06-21 01:19:38 +02:00
2020-02-10 16:58:44 +01:00
raygui is intended for **tools development**; it has already been used to develop the following tools: [rFXGen](https://github.com/raysan5/rfxgen), [rTexViewer](https://raylibtech.itch.io/rtexviewer), [rTexPacker](https://raylibtech.itch.io/rtexpacker) [rGuiStyler](https://raylibtech.itch.io/rguistyler), [rGuiLayout](https://raylibtech.itch.io/rguilayout) and [rGuiIcons](https://raylibtech.itch.io/rguiicons)
2017-08-06 10:58:09 +02:00
2018-07-21 13:47:07 +02:00
<br>
2019-08-28 11:54:36 +02:00
## raygui provided controls
2017-06-21 01:19:38 +02:00
2019-08-28 11:56:15 +02:00
#### Container/separator controls
2019-08-28 12:23:49 +02:00
```
2019-08-28 12:26:35 +02:00
WindowBox | GroupBox | Line | Panel
2019-08-28 12:23:49 +02:00
```
2018-05-02 23:51:13 +02:00
#### Basic controls
2019-08-28 12:23:49 +02:00
```
2019-08-28 12:26:35 +02:00
Label | Button | LabelButton | ImageButton | Toggle | ToggleGroup | CheckBox
2021-07-28 12:55:58 +02:00
ComboBox | DropdownBox | TextBox | TextBoxMulti | ValueBox | Spinner | Slider
2019-08-28 12:26:35 +02:00
SliderBar | ProgressBar | StatusBar | ScrollBar | ScrollPanel | DummyRec | Grid
2019-08-28 12:23:49 +02:00
```
#### Advance controls
```
2019-08-28 12:26:35 +02:00
ListView | ColorPicker | MessageBox | TextInputBox
2019-08-28 12:23:49 +02:00
```
2018-05-02 21:09:18 +02:00
2019-08-28 11:54:36 +02:00
## raygui styles
raygui comes with a [default](styles/default) style automatically loaded at runtime:
![raygui default style](styles/default/style_table.png)
Some additional styles are also provided for convenience, just check [styles directory](styles) for details:
![raygui additional styles](images/raygui_style_table_multi.png)
2021-07-28 12:55:58 +02:00
Custom styles can also be created very easily using [rGuiStyler](https://raylibtech.itch.io/rguistyler) tool.
2019-08-28 11:54:36 +02:00
Styles can be loaded at runtime using raygui `GuiLoadStyle()` function. Simple and easy-to-use.
2019-08-28 12:26:35 +02:00
![rGuiStyler v3.1](images/rguistyler_v300.png)
*rGuiStyler v3.1 - raygui styles editor, useful to create custom styles*
2021-07-28 12:55:58 +02:00
2020-02-10 16:58:44 +01:00
## raygui icons
2019-08-28 11:54:36 +02:00
`raygui` supports custom icons provided as an external array of data. To support icons just define `RAYGUI_SUPPORT_RICONS` before including `raygui`.
2020-02-10 16:58:44 +01:00
2021-07-28 12:55:58 +02:00
A set of custom handcrafted icons is provided in [`ricons`](src/ricons.h). This set of icons can be created and customized using [rGuiIcons](https://raylibtech.itch.io/rguiicons) tool.
2019-08-28 11:54:36 +02:00
<img align="right" src="images/raygui_ricons.png">
```c
#define RAYGUI_IMPLEMENTATION
#define RAYGUI_SUPPORT_RICONS
2019-08-28 11:54:36 +02:00
#include "raygui.h"
```
To use any of those icons in your gui, just preprend *iconId* to any text written within `raygui` controls:
```c
if (GuiButton(rec, "#05#Open Image")) { /* ACTION */ }
2019-08-28 11:54:36 +02:00
```
or use the provided `GuiIconText()` function to prepend it automatically, using a clearer identifier.
```c
if (GuiButton(rec, GuiIconText(RICON_FILE_OPEN, "Open Image"))) { /* ACTION */ }
```
2016-09-07 18:25:06 +02:00
## building as shared library
`raygui` is intended to be used as a portable library to be integrated in code form into the target project but some users could require a shared/dynamic version of the library, for example, to create bindings. In that case, `raygui` can be built as a shared library using:
```
mv src/raygui.h src/raygui.c && gcc -shared -fpic -DRAYGUI_SUPPORT_RICONS -DRAYGUI_IMPLEMENTATION -lraylib -lGL -lm -lpthread -ldl -lrt -lX11 src/raygui.c -o raygui.so
```
2019-08-24 21:06:51 +02:00
license
-------
2016-09-07 18:25:06 +02:00
2020-02-28 10:19:21 +01:00
raygui is licensed under an unmodified zlib/libpng license, which is an OSI-certified, BSD-like license that allows static linking with closed source software. Check [LICENSE](LICENSE) for further details.