{"id":13424710,"url":"https://github.com/raysan5/raygui","last_synced_at":"2025-05-14T13:09:33.410Z","repository":{"id":38713042,"uuid":"61231339","full_name":"raysan5/raygui","owner":"raysan5","description":"A simple and easy-to-use immediate-mode gui library","archived":false,"fork":false,"pushed_at":"2025-05-06T20:09:08.000Z","size":12826,"stargazers_count":4028,"open_issues_count":21,"forks_count":334,"subscribers_count":55,"default_branch":"master","last_synced_at":"2025-05-06T21:23:51.137Z","etag":null,"topics":["buttons","gui","imgui","raylib","ui-design","ui-library"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"zlib","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/raysan5.png","metadata":{"files":{"readme":"README.md","changelog":"HISTORY.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"raysan5","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2016-06-15T18:33:19.000Z","updated_at":"2025-05-06T20:09:11.000Z","dependencies_parsed_at":"2023-02-17T20:46:05.047Z","dependency_job_id":"afb16e8e-af2c-4d4c-8de7-5e5d1a27bf80","html_url":"https://github.com/raysan5/raygui","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raysan5%2Fraygui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raysan5%2Fraygui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raysan5%2Fraygui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raysan5%2Fraygui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/raysan5","download_url":"https://codeload.github.com/raysan5/raygui/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254149976,"owners_count":22022852,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["buttons","gui","imgui","raylib","ui-design","ui-library"],"created_at":"2024-07-31T00:00:58.181Z","updated_at":"2025-05-14T13:09:28.396Z","avatar_url":"https://github.com/raysan5.png","language":"C","readme":"\u003cimg align=\"left\" src=\"logo/raygui_256x256.png\" width=256\u003e\n\n**raygui is a simple and easy-to-use immediate-mode-gui library.**\n\n`raygui` was originally inspired by [Unity IMGUI](https://docs.unity3d.com/Manual/GUIScriptingGuide.html) (immediate mode GUI API).\n\n`raygui` was designed as an auxiliary module for [raylib](https://github.com/raysan5/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.\n\n`raygui` is intended for **tools development**; it has already been used to develop [multiple published tools](https://raylibtech.itch.io).\n\n\u003cbr\u003e\n\n**WARNING: Latest `raygui` from master branch is always aligned with latest `raylib` from master branch. Make sure to use the appropiate versions.**\n\n**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)**\n\n*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.*\n\n## features\n\n - **Immediate-mode gui, no retained data**\n - **+25** controls provided (basic and advanced)\n - Powerful **styling system** for colors, font and metrics\n - Standalone usage mode supported (for other graphic libs)\n - **Icons support**, embedding a complete 1-bit icons pack\n - Multiple **tools** provided for raygui development\n\n## code sample\n```c\n#include \"raylib.h\"\n\n#define RAYGUI_IMPLEMENTATION\n#include \"raygui.h\"\n\nint main()\n{\n    InitWindow(400, 200, \"raygui - controls test suite\");\n    SetTargetFPS(60);\n\n    bool showMessageBox = false;\n\n    while (!WindowShouldClose())\n    {\n        // Draw\n        //----------------------------------------------------------------------------------\n        BeginDrawing();\n            ClearBackground(GetColor(GuiGetStyle(DEFAULT, BACKGROUND_COLOR)));\n\n            if (GuiButton((Rectangle){ 24, 24, 120, 30 }, \"#191#Show Message\")) showMessageBox = true;\n\n            if (showMessageBox)\n            {\n                int result = GuiMessageBox((Rectangle){ 85, 70, 250, 100 },\n                    \"#191#Message Box\", \"Hi! This is a message!\", \"Nice;Cool\");\n\n                if (result \u003e= 0) showMessageBox = false;\n            }\n\n        EndDrawing();\n    }\n\n    CloseWindow();\n    return 0;\n}\n```\n![screenshot000](https://github.com/raysan5/raygui/assets/5766837/170e2bce-b7ca-49dc-a263-32b673376546)\n\n## raygui controls\n\n### basic controls\n```\nLabel       |  Button      |  LabelButton |  Toggle      |  ToggleGroup  |  ToggleSlider\nCheckBox    |  ComboBox    |  DropdownBox |  TextBox     |  ValueBox     |  Spinner\nSlider      |  SliderBar   |  ProgressBar |  StatusBar   |  DummyRec     |  Grid\n```\n### container/separator controls\n```\nWindowBox   |  GroupBox    |  Line        |  Panel       |  ScrollPanel  | TabBar\n```\n### advanced controls\n```\nListView    |  ColorPicker |  MessageBox  |  TextInputBox\n```\n\n\n## raygui styles\n\n`raygui` comes with a [default](styles/default) style automatically loaded at runtime:\n\n![raygui default style](styles/default/style_default.png)\n\nSome additional styles are also provided for convenience, just check [styles directory](styles) for details:\n\n![raygui additional styles](images/raygui_style_table_multi.png)\n\nCustom styles can also be created very easily using [rGuiStyler](https://raylibtech.itch.io/rguistyler) tool.\n\nStyles can be loaded at runtime using raygui `GuiLoadStyle()` function. Simple and easy-to-use.\n\n## raygui icons\n\n`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`.\n\n\u003cimg align=\"right\" src=\"images/raygui_ricons.png\"\u003e\n\nTo use any of those icons just prefix the *#iconId#* number to **any text** written within `raygui` controls:\n```c\nif (GuiButton(rec, \"#05#Open Image\")) { /* ACTION */ }\n```\nIt's also possible to use the provided `GuiIconText()` function to prefix it automatically, using a clearer identifier (defined in `raygui.h`).\n```c\nif (GuiButton(rec, GuiIconText(RICON_FILE_OPEN, \"Open Image\"))) { /* ACTION */ }\n```\nProvided set of icons can be reviewed and customized using [rGuiIcons](https://raylibtech.itch.io/rguiicons) tool.\n\n## raygui support tools\n\n - [**rGuiStyler**](https://raylibtech.itch.io/rguistyler) - A simple and easy-to-use raygui styles editor.\n\n   ![rGuiStyler v3.1](images/rguistyler_v300.png)\n\n - [**rGuiIcons**](https://raylibtech.itch.io/rguiicons) - A simple and easy-to-use raygui icons editor.\n\n   ![rGuiIcons v1.0](images/rguiicons_v100.png)\n\n - [**rGuiLayout**](https://raylibtech.itch.io/rguilayout) - A simple and easy-to-use raygui layouts editor.\n\n   ![rGuiLayout v2.2](images/rguilayout_v220.png)\n\n## building\n\n`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:\n\n - **Windows (MinGW, GCC)**\n```\ncopy src/raygui.h src/raygui.c\ngcc -o src/raygui.dll src/raygui.c -shared -DRAYGUI_IMPLEMENTATION -DBUILD_LIBTYPE_SHARED -static-libgcc -lopengl32 -lgdi32 -lwinmm -Wl,--out-implib,src/librayguidll.a\n```\n\n - **Windows (MSVC)**\n```\ncopy src\\raygui.h src\\raygui.c\ncl /O2 /I../raylib/src/ /D_USRDLL /D_WINDLL /DRAYGUI_IMPLEMENTATION /DBUILD_LIBTYPE_SHARED src/raygui.c /LD /Feraygui.dll /link /LIBPATH ../raylib/build/raylib/Release/raylib.lib /subsystem:windows /machine:x64\n```\n\n - **Linux (GCC)**\n```\nmv src/raygui.h src/raygui.c\ngcc -o raygui.so src/raygui.c -shared -fpic -DRAYGUI_IMPLEMENTATION -lraylib -lGL -lm -lpthread -ldl -lrt -lX11\nmv src/raygui.c src/raygui.h\n```\n\n- **Mac (clang, homebrew installed raylib)**\n```\ncp src/raygui.h src/raygui.c\nbrew install raylib\ngcc -o raygui.dynlib src/raygui.c -shared -fpic -DRAYGUI_IMPLEMENTATION -framework OpenGL -lm -lpthread -ldl $(pkg-config --libs --cflags raylib)\n```\n\n\n## license\n\nraygui 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.\n","funding_links":["https://github.com/sponsors/raysan5"],"categories":["C","Graphics","List","前端开发框架及项目","UI"],"sub_categories":["Promo Images","前端项目_其他"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraysan5%2Fraygui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraysan5%2Fraygui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraysan5%2Fraygui/lists"}