{"id":18736349,"url":"https://github.com/matcool/gd-imgui-cocos","last_synced_at":"2025-04-12T19:31:05.871Z","repository":{"id":98990617,"uuid":"557591192","full_name":"matcool/gd-imgui-cocos","owner":"matcool","description":"imgui in gd via cocos","archived":false,"fork":false,"pushed_at":"2025-04-04T02:11:48.000Z","size":148,"stargazers_count":16,"open_issues_count":1,"forks_count":13,"subscribers_count":1,"default_branch":"geode","last_synced_at":"2025-04-04T02:19:52.193Z","etag":null,"topics":["geode-sdk","geometry-dash","imgui"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/matcool.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":"2022-10-26T00:30:03.000Z","updated_at":"2025-04-04T02:11:51.000Z","dependencies_parsed_at":"2023-04-08T05:16:46.638Z","dependency_job_id":"cb9855f0-2302-4275-a434-b4234609eabd","html_url":"https://github.com/matcool/gd-imgui-cocos","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matcool%2Fgd-imgui-cocos","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matcool%2Fgd-imgui-cocos/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matcool%2Fgd-imgui-cocos/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matcool%2Fgd-imgui-cocos/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matcool","download_url":"https://codeload.github.com/matcool/gd-imgui-cocos/tar.gz/refs/heads/geode","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248620945,"owners_count":21134714,"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":["geode-sdk","geometry-dash","imgui"],"created_at":"2024-11-07T15:20:26.009Z","updated_at":"2025-04-12T19:31:05.849Z","avatar_url":"https://github.com/matcool.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gd-imgui-cocos\n\nimgui in gd using only cocos! ~~no hooks or anything~~ for geode\n\n## setup\n\nlink to it like any other cmake library, you can also use cpm which comes with geode\n\n```cmake\nCPMAddPackage(\"gh:matcool/gd-imgui-cocos#commithash\") # specify a commit!\n\ntarget_link_libraries(${PROJECT_NAME} imgui-cocos)\n```\n\nYou may specify what version of imgui you want to use by setting `IMGUI_VERSION` before including the library:\n\n```cmake\nset(IMGUI_VERSION \"v1.70\")\nCPMAddPackage(\"gh:matcool/gd-imgui-cocos#...\")\n```\n\nOr even get imgui yourself, and setting the `HAS_IMGUI` option:\n```cmake\nadd_subdirectory(my-epic-imgui)\n\nset(HAS_IMGUI ON)\nCPMAddPackage(\"gh:matcool/gd-imgui-cocos#...\")\n```\n\n\n## usage\n\nMake sure you call the `setup` method! Even if you don't need the callback you can use the overload with no args.\n\n```cpp\n#include \u003cimgui-cocos.hpp\u003e\n\n$on_mod(Loaded) {\n    ImGuiCocos::get().setup([] {\n        // this runs after imgui has been setup,\n        // its a callback as imgui will be re initialized when toggling fullscreen,\n        // so use this to setup any themes and or fonts!\n    }).draw([] {\n        ImGui::Begin(\"My awesome window\");\n\n        ImGui::Button(\"Awesome button\");\n        \n        ImGui::End();\n    });\n}\n```\n\nThis code will create a floating window that will persist throughout scenes, and should always be on top of everything\n\n## random\n\nHeres how you can add your own fonts from mod resources, because i always forget. \\\nMake sure that in your `mod.json` the ttf is a `file`, instead of a font! you don't want it as a gd font, you want the actual ttf file\n\n```cpp\nImGuiCocos::get().setup([] {\n    // you should do this in setup! ok thx\n    auto* font = ImGui::GetIO().Fonts-\u003eAddFontFromFileTTF((Mod::get()-\u003egetResourcesDir() / \"whatever.ttf\").string().c_str(), 16.0f);\n    // do something with the font.. like io.FontDefault or something\n})//.draw(... etc\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatcool%2Fgd-imgui-cocos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatcool%2Fgd-imgui-cocos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatcool%2Fgd-imgui-cocos/lists"}