{"id":16186847,"url":"https://github.com/robloach/raylib-nuklear","last_synced_at":"2025-08-21T20:33:06.025Z","repository":{"id":40699053,"uuid":"256921676","full_name":"RobLoach/raylib-nuklear","owner":"RobLoach","description":"Nuklear immediate mode GUI for raylib","archived":false,"fork":false,"pushed_at":"2024-05-22T17:16:17.000Z","size":1904,"stargazers_count":102,"open_issues_count":5,"forks_count":14,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-05-22T18:33:36.823Z","etag":null,"topics":["nuklear","raylib"],"latest_commit_sha":null,"homepage":"https://robloach.github.io/raylib-nuklear/","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/RobLoach.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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}},"created_at":"2020-04-19T05:27:20.000Z","updated_at":"2024-05-22T18:33:42.068Z","dependencies_parsed_at":"2024-03-29T20:24:00.713Z","dependency_job_id":"2c222fed-c856-47c3-bba0-6ea561e828fd","html_url":"https://github.com/RobLoach/raylib-nuklear","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobLoach%2Fraylib-nuklear","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobLoach%2Fraylib-nuklear/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobLoach%2Fraylib-nuklear/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobLoach%2Fraylib-nuklear/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RobLoach","download_url":"https://codeload.github.com/RobLoach/raylib-nuklear/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230532448,"owners_count":18240792,"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":["nuklear","raylib"],"created_at":"2024-10-10T07:19:44.056Z","updated_at":"2024-12-20T04:08:00.335Z","avatar_url":"https://github.com/RobLoach.png","language":"C","readme":"# raylib-nuklear\n\nUse the [Nuklear](https://github.com/Immediate-Mode-UI/Nuklear) immediate mode cross-platform GUI library in [raylib](https://www.raylib.com/).\n\n[![raylib-nuklear-example Screenshot](examples/raylib-nuklear-example.png)](examples)\n\n## Usage\n\n1. Since this is a header-only library, you must first define `RAYLIB_NUKLEAR_IMPLEMENTATION` in one of your `.c` files...\n    ``` c\n    #define RAYLIB_NUKLEAR_IMPLEMENTATION\n    ```\n2. Include the [`raylib-nuklear.h`](include/raylib-nuklear.h) file...\n    ``` c\n    #include \"path/to/raylib-nuklear.h\"\n    ```\n3. Use `InitNuklear(fontSize)` or `InitNuklearEx(font, fontSize)` to create the nuklear context...\n    ``` c\n    struct nk_context *ctx = InitNuklear(10);\n    ```\n4. Build your Nuklear GUI through the standard [Nuklear API](https://github.com/Immediate-Mode-UI/Nuklear/wiki/Window)\n5. Update the input for the GUI using `UpdateNuklear(ctx)`\n6. Render the context using `DrawNuklear(ctx)`\n7. Destroy the nuklear context with `UnloadNuklear(ctx)`\n\n## Example\n\n``` c\n#define RAYLIB_NUKLEAR_IMPLEMENTATION\n#include \"raylib-nuklear.h\"\n\nint main() {\n    InitWindow(640, 480, \"raylib-nuklear example\");\n\n    // Create the Nuklear Context\n    int fontSize = 10;\n    struct nk_context *ctx = InitNuklear(fontSize);\n\n    while (!WindowShouldClose()) {\n        // Update the Nuklear context, along with input\n        UpdateNuklear(ctx);\n\n        // Nuklear GUI Code\n        // https://github.com/Immediate-Mode-UI/Nuklear/wiki/Window\n        if (nk_begin(ctx, \"Nuklear\", nk_rect(100, 100, 220, 220),\n                NK_WINDOW_BORDER|NK_WINDOW_MOVABLE|NK_WINDOW_CLOSABLE)) {\n            nk_layout_row_static(ctx, 50, 150, 1);\n            if (nk_button_label(ctx, \"Button\")) {\n                // Button was clicked!\n            }\n        }\n        nk_end(ctx);\n\n        // Render\n        BeginDrawing();\n            ClearBackground(RAYWHITE);\n\n            // Render the Nuklear GUI\n            DrawNuklear(ctx);\n\n        EndDrawing();\n    }\n\n    // De-initialize the Nuklear GUI\n    UnloadNuklear(ctx);\n\n    CloseWindow();\n    return 0;\n}\n```\n\n## API\n\n``` c\nstruct nk_context* InitNuklear(int fontSize);                // Initialize the Nuklear GUI context using raylib's font\nstruct nk_context* InitNuklearEx(Font font, float fontSize); // Initialize the Nuklear GUI context, with a custom font\nFont LoadFontFromNuklear(int fontSize);                      // Loads the default Nuklear font\nvoid UpdateNuklear(struct nk_context * ctx);                 // Update the input state and internal components for Nuklear\nvoid UpdateNuklearEx(struct nk_context * ctx, float deltaTime); // Update the input state and internal components for Nuklear, with a custom frame time\nvoid DrawNuklear(struct nk_context * ctx);                   // Render the Nuklear GUI on the screen\nvoid UnloadNuklear(struct nk_context * ctx);                 // Deinitialize the Nuklear context\nstruct nk_color ColorToNuklear(Color color);                 // Convert a raylib Color to a Nuklear color object\nstruct nk_colorf ColorToNuklearF(Color color);               // Convert a raylib Color to a Nuklear floating color\nstruct Color ColorFromNuklear(struct nk_color color);        // Convert a Nuklear color to a raylib Color\nstruct Color ColorFromNuklearF(struct nk_colorf color);      // Convert a Nuklear floating color to a raylib Color\nstruct Rectangle RectangleFromNuklear(struct nk_context * ctx, struct nk_rect rect); // Convert a Nuklear rectangle to a raylib Rectangle\nstruct nk_rect RectangleToNuklear(struct nk_context * ctx, Rectangle rect); // Convert a raylib Rectangle to a Nuklear Rectangle\nstruct nk_image TextureToNuklear(Texture tex);               // Convert a raylib Texture to A Nuklear image\nstruct Texture TextureFromNuklear(struct nk_image img);      // Convert a Nuklear image to a raylib Texture\nstruct nk_image LoadNuklearImage(const char* path);          // Load a Nuklear image\nvoid UnloadNuklearImage(struct nk_image img);                // Unload a Nuklear image. And free its data\nvoid CleanupNuklearImage(struct nk_image img);               // Frees the data stored by the Nuklear image\nvoid SetNuklearScaling(struct nk_context * ctx, float scaling); // Sets the scaling for the given Nuklear context\nfloat GetNuklearScaling(struct nk_context * ctx);            // Retrieves the scaling of the given Nuklear context\n```\n\nSee the [Nuklear API documenation](https://immediate-mode-ui.github.io/Nuklear/doc/nuklear.html) for more how to use Nuklear.\n\n## Comparision\n\nThere are a few other graphical user interface solutions out there for use with raylib. [raygui](https://github.com/raysan5/raygui), [Nuklear](https://github.com/Immediate-Mode-UI/Nuklear), and [ImGui](https://github.com/ocornut/imgui) with [rlImGui](https://github.com/raylib-extras/rlImGui), are popular choices. It's best to choose the GUI that fits your needs best. Generally, if you're unsure which GUI to use with raylib, use [raygui](https://github.com/raysan5/raygui).\n\n| | [Nuklear](https://github.com/Immediate-Mode-UI/Nuklear) | [raygui](https://github.com/raysan5/raygui) | [rlImGui](https://github.com/raylib-extras/rlImGui) |\n| ----- |:-------:|:------:|:-----:|\n| Only C | :white_check_mark: | :white_check_mark: | C++ |\n| Minimal Dependencies |  :white_check_mark: |  :white_check_mark: | :x: |\n| Automatic Layouts | :white_check_mark: | :x: | :white_check_mark: |\n| Advanced Controls | :white_check_mark: | :x: | :white_check_mark: |\n| Documentation | :white_check_mark: | :x: | :white_check_mark: |\n| Industry Standard | :x: | :x: | :white_check_mark: |\n| Easy to Use | :x: | :white_check_mark: | :x: |\n\n## Development\n\nWhile this project uses CMake, CMake is not required in order to use *raylib-nuklear*.\n\n```\ngit submodule update --init\nmkdir build\ncd build\ncmake ..\nmake\n./example/raylib-nuklear-example\nmake test\n```\n\n## License\n\n*raylib-nuklear* 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":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobloach%2Fraylib-nuklear","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobloach%2Fraylib-nuklear","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobloach%2Fraylib-nuklear/lists"}