Apply the Candy style to raygui
masterraygui application using several different file formats depending on your project's requirements (e.g., embedding vs. external loading).repository·master·Indexed 26 days ago
https://github.com/raysan5/rayguiA simple, immediate-mode GUI library designed for tools development. Intended as an auxiliary module for raylib but adaptable to other engines, raygui is provided as a single-file header-only library. It supports custom styles via GuiLoadStyle(), a built-in set of 512 icons, and can be built using CMake or as a shared/dynamic library for Windows, Linux, and macOS.
raygui application using several different file formats depending on your project's requirements (e.g., embedding vs. external loading).The cyber style can be integrated into a raygui application using several different methods depending on your project requirements. Choose the format that best fits your build process:
style_cyber.h for a self-contained, embeddable style that includes font data directly in your source code.style_cyber.rgs (for raygui 4.0+) which contains compressed font data (recs, glyphs).style_cyber.txt.rgs if you prefer a text-based format, but note that this requires you to provide an external font.style_cyber.old.rgs for raygui 3.x projects (contains uncompressed font data).style_cyber.png, which contains the binary .rgs file data within an rGSf chunk.If you prefer not to ship external .rgs files, you can embed styles directly into your source code. raygui provides .h files for every style which contain all required style and font data. To use this method:
.h file to your project.The 'bluish' style can be integrated into a raygui application using several different file formats depending on your project requirements. Choose the format that best fits your build process:
style_bluish.h: Best for embedded applications. This is a self-contained C header file that includes the style and font data as code.style_bluish.rgs: A binary style file (compatible with raygui 4.0) that includes compressed font data (recs, glyphs).style_bluish.txt.rgs: A text-based style file. Note that this version does not include font data and requires you to provide an external font.style_bluish.old.rgs: A binary style file for older versions (raygui 3.x) with uncompressed font data.style_bluish.png: A style table image that contains the binary rgs file data within an rGSf chunk.raygui is a single-file header-only library. To use it in your C/C++ project, include raygui.h.
Crucial: You must define RAYGUI_IMPLEMENTATION in exactly one compilation unit before including the header to include the function definitions. In all other modules that need to use raygui, include raygui.h without defining RAYGUI_IMPLEMENTATION.
#include "raylib.h"
#define RAYGUI_IMPLEMENTATION
#include "raygui.h"
int main() {
// Your code here
return 0;
}If you need to create bindings or use a shared version of the library, you can build it as a DLL or SO. Note that for Windows (MSVC), you should use the "Developer Command Prompt for VS 2022" to ensure cl is accessible.
copy src/raygui.h src/raygui.c
gcc -o src/raygui.dll src/raygui.c -shared -DRAYGUI_IMPLEMENTATION -DBUILD_LIBTYPE_SHARED -static-libgcc -lopengl32 -lgdi32 -lwinmm -Wl,--out-implib,src/librayguidll.acopy src\raygui.h src\raygui.c
cl /O2 /I<RELATIVE_PATH_TO_RAYLIB_INCLUDE_DIR> /D_USRDLL /D_WINDLL /DRAYGUI_IMPLEMENTATION /DBUILD_LIBTYPE_SHARED src/raygui.c /LD /Feraygui.dll /link /LIBPATH <RELATIVE_PATH_TO_RAYLIB_IMPORT_LIBRARY> msvcrt.lib winmm.lib gdi32.lib user32.lib shell32.lib /subsystem:windows /machine:x64mv src/raygui.h src/raygui.c
gcc -o raygui.so src/raygui.c -shared -fpic -DRAYGUI_IMPLEMENTATION -lraylib -lGL -lm -lpthread -ldl -lrt -lX11
mv src/raygui.c src/raygui.hcp src/raygui.h src/raygui.c
brew install raylib
gcc -o raygui.dynlib src/raygui.c -shared -fpic -DRAYGUI_IMPLEMENTATION -framework OpenGL -lm -lpthread -ldl $(pkg-config --libs --cflags raylib)To build raygui using the provided CMake definition files, navigate to the projects/CMake directory and follow the standard CMake build workflow: create a build directory, run cmake pointing to the source, and then compile using make.
cd projects/CMake
mkdir build
cd build
cmake ..
makeThe Cherry style can be integrated into your raygui project using several different file formats depending on your requirements for portability, ease of use, or file size. Choose one of the following methods:
style_cherry.h to include the style directly in your code. This is self-contained and includes the necessary font data.style_cherry.rgs. This is a compressed binary file containing both style records and font glyphs.style_cherry.txt.rgs. This contains only text-based style data and requires you to provide an external font.style_cherry.old.rgs. This is an uncompressed binary file containing style records and font glyphs.style_cherry.png. The binary rgs data is embedded within the rGSf chunk of the PNG image.raygui includes a built-in set of 512 icons (16x16 pixels, 1-bit). You can display icons in any control by prefixing the icon ID to the text using the #iconId# format.
Alternatively, use the GuiIconText() function to automatically prefix the icon using a clear identifier defined in raygui.h.
raygui application, call the GuiLoadStyle() function during initialization. You must pass the path to the .rgs file. These files are binary and contain the necessary font data (glyphs data and glyph atlas image data) required for the style to function.The ashes style can be integrated into a raygui application using several different file formats depending on your project requirements. Choose the format that best fits your deployment strategy:
style_ashes.h to embed the style directly as code. This is self-contained and includes the necessary font data.style_ashes.rgs. This is a binary file with compressed font data (recs, glyphs).style_ashes.txt.rgs. This is a text style file that does not include font data; you must provide an external font manually.style_ashes.old.rgs. This is a binary file with uncompressed font data.style_ashes.png. This style table image contains an rGSf chunk which holds the binary rgs file data.You can integrate the 'dark' style into your raygui project using several different methods depending on your requirements for portability, file size, or ease of use.
Choose one of the following files:
style_dark.h: Best for ease of use. It is a self-contained C header file that embeds the style and font data directly into your code.style_dark.rgs: A binary style file (compatible with raygui 4.0) that includes compressed font data.style_dark.txt.rgs: A text-based style file that does not include font data; you must provide an external font.style_dark.old.rgs: A binary style file for older versions (raygui 3.x) with uncompressed font data.style_dark.png: A style table image that contains the binary rgs data within an rGSf chunk.