GitHub Hot Board

GitHub Hot Board · 저장소 아카이브

raysan5/raygui

A simple and easy-to-use immediate-mode gui library (소개는 저장소 자체 문서에서 왔습니다.)

데이터 기준 October 27raysan5

최고 순위

#415

종합 · C 언어별

5.2K

누적 스타

404

포크 수

0

최근 30일 기록 일수

프로젝트 상태라이선스: Zlib최근 push: October 20열린 이슈(PR 포함): 1

2026-10-25부터 수집. 미확인 = 아직 미수집

README에 뱃지를 붙여보세요 · raysan5/raygui[![README에 뱃지를 붙여보세요](https://git.vaiox.xyz/api/badge/raysan5/raygui.svg)](https://git.vaiox.xyz/ko/repo/raysan5/raygui)

Badge · 任何仓库都可以挂 —— 未上榜的仓库显示灰章,上完榜会自动点亮。

<a href="https://git.vaiox.xyz/ko/repo/raysan5/raygui"><img src="https://git.vaiox.xyz/api/badge/raysan5/raygui.svg" alt="README에 뱃지를 붙여보세요" height="20"></a>

프로젝트 문서

raygui is a simple and easy-to-use immediate-mode-gui library.

raygui was originally inspired by Unity IMGUI (immediate mode GUI API).

raygui was designed as an auxiliary module for raylib to create simple GUI interfaces using raylib graphic style (simple colors, plain rectangular shapes, wide borders...) but it can be adapted to other engines/frameworks.

raygui is intended for tools development; it has already been used to develop multiple published tools.


WARNING: Latest raygui from master branch is always aligned with latest raylib from master branch and all raylibtech tools. Make sure to use the latest versions.

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.

features

  • Immediate-mode gui, no retained data
  • +25 controls provided (basic and advanced)
  • Powerful styling system for colors, font and metrics
  • Standalone usage mode supported (for other graphic libs)
  • Icons support, embedding a complete 1-bit icons pack
  • Multiple tools provided for raygui development

code sample

#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 btnActive = -1;
                GuiMessageBox((Rectangle){ 85, 70, 250, 100 },
                    "#191#Message Box", "Hi! This is a message!", "Nice;Cool", &btnActive);

                if (btnActive >= 0) showMessageBox = false;
            }

        EndDrawing();
    }

    CloseWindow();
    return 0;
}

screenshot000

raygui controls

basic controls

Label       |  Button      |  LabelButton |  Toggle      |  ToggleGroup  |  ToggleSlider
CheckBox    |  ComboBox    |  DropdownBox |  TextBox     |  ValueBox     |  Spinner
Slider      |  SliderBar   |  ProgressBar |  StatusBar   |  DummyRec     |  Grid

container/separator controls

WindowBox   |  GroupBox    |  Line        |  Panel       |  ScrollPanel  | TabBar

advanced controls

ListView    |  ColorPicker |  MessageBox  |  TextInputBox

raygui styles

raygui comes with a default style automatically loaded at runtime:

raygui default style

Some additional styles are also provided for convenience, just check styles directory for details:

raygui additional styles

Custom styles can also be created very easily using rGuiStyler tool.

Styles can be loaded at runtime using raygui GuiLoadStyle() function. Simple and easy-to-use.

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 512 possible icons defined as 16x16 pixels each; each pixel is codified using 1-bit. The total size of the array is 4096 bytes.

raygui icons v5

To use any of those icons just prefix the #iconId# number to any text written within raygui controls:

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).

if (GuiButton(rec, GuiIconText(ICON_FILE_OPEN, "Open Image"))) { /* ACTION */ }

Provided set of icons can be reviewed and customized using rGuiIcons tool.

raygui support tools

  • rGuiStyler - A simple and easy-to-use raygui styles editor.

    rGuiStyler v6.0

  • rGuiIcons - A simple and easy-to-use raygui icons editor.

    rGuiIcons v4.0

  • rGuiLayout - A simple and easy-to-use raygui layouts editor.

    rGuiLayout v5.0

building

raygui is intended to be used as a portable single-file header-only library, to be directly integrated into any C/C++ codebase but some users could require a shared/dynamic version of the library, for example, to create bindings:

  • Windows (MinGW, GCC)
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.a
  • Windows (MSVC)
copy src\raygui.h src\raygui.c
# For `cl` to be accessible open "Developer Command Prompt for VS 2022".
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:x64

# Example:
# cl /O2 /I../raylib-6_0_win64_msvc16/include /D_USRDLL /D_WINDLL /DRAYGUI_IMPLEMENTATION /DBUILD_LIBTYPE_SHARED src/raygui.c /LD /Feraygui.dll /link /LIBPATH ../raylib-6_0_win64_msvc16/lib/raylibdll.lib msvcrt.lib winmm.lib gdi32.lib user32.lib shell32.lib /subsystem:windows /machine:x64
  • Linux (GCC)
mv 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.h
  • Mac (clang, homebrew installed raylib)
cp 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)

license

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 for further details.

현재 순위

  • 415

    종합 랭킹 · 역대 최강 · C

    5.2K 스타 · 404 fork · 총 스타 수

    종합 · C →

최근 30일 추이

최근 30일간 기록이 없습니다.

비슷한 프로젝트 · 공유 토픽

← 랭킹으로

GitHub Hot Board타임머신Discover