{"id":23147871,"url":"https://github.com/altschuler/imgui-knobs","last_synced_at":"2025-10-12T04:34:59.690Z","repository":{"id":37912085,"uuid":"482544820","full_name":"altschuler/imgui-knobs","owner":"altschuler","description":"Knob widgets for Dear ImGui","archived":false,"fork":false,"pushed_at":"2025-06-23T06:16:10.000Z","size":728,"stargazers_count":369,"open_issues_count":1,"forks_count":49,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-06-23T07:28:41.738Z","etag":null,"topics":["cpp","gui","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/altschuler.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,"zenodo":null}},"created_at":"2022-04-17T14:26:03.000Z","updated_at":"2025-06-23T06:16:14.000Z","dependencies_parsed_at":"2024-12-17T17:01:54.892Z","dependency_job_id":"4b8a8e77-9e34-42a9-ad44-d8e73ad40fc9","html_url":"https://github.com/altschuler/imgui-knobs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/altschuler/imgui-knobs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/altschuler%2Fimgui-knobs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/altschuler%2Fimgui-knobs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/altschuler%2Fimgui-knobs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/altschuler%2Fimgui-knobs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/altschuler","download_url":"https://codeload.github.com/altschuler/imgui-knobs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/altschuler%2Fimgui-knobs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279010258,"owners_count":26084719,"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","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["cpp","gui","imgui"],"created_at":"2024-12-17T17:00:55.631Z","updated_at":"2025-10-12T04:34:59.662Z","avatar_url":"https://github.com/altschuler.png","language":"C++","readme":"# ImGui Knobs\nThis is a port/adaptation of [imgui-rs-knobs](https://github.com/DGriffin91/imgui-rs-knobs), for C++.\n\n![image](https://user-images.githubusercontent.com/956928/164050142-96a8dde4-7d2e-43e4-9afe-14ab48eac243.png)\n\n## Usage\nAdd `imgui-knobs.cpp` and `imgui-knobs.h` to your project and include `imgui-knobs.h` in some source file.\n\n\n```cpp\nstatic float value = 0;\n\nif (ImGuiKnobs::Knob(\"Volume\", \u0026value, -6.0f, 6.0f, 0.1f, \"%.1fdB\", ImGuiKnobVariant_Tick)) {\n    // value was changed\n}\n```\n\nDraw knobs using either `Knob` or `KnobInt`. The API is:\n\n```\nbool ImGuiKnobs::Knob(label, *value, min, max, [speed, format, variant, size, flags, steps, angle_min, angle_max])\nbool ImGuiKnobs::KnobInt(label, *value, min, max, [speed, format, variant, size, flags, steps, angle_min, angle_max])\n```\n\nYou can implement **double click to reset** using standard imgui functionality:\n\n```cpp\nImGuiKnobs::Knob(\"Volume\", \u0026value, -6.0f, 6.0f, 0.1f, \"%.1fdB\", ImGuiKnobVariant_Tick);\n\n// Double click to reset, must be directly after drawing the knob so the right imgui \"item\" is used\nif (ImGui::IsItemActive() \u0026\u0026 ImGui::IsMouseDoubleClicked(0)) {\n    value = 0;\n}\n```\n\nSee `example/main.cpp` for a demo.\n\n### Variants\n`variant` determines the visual look of the knob. Available variants are: `ImGuiKnobVariant_Tick`, `ImGuiKnobVariant_Dot`, `ImGuiKnobVariant_Wiper`, `ImGuiKnobVariant_WiperOnly`, `ImGuiKnobVariant_WiperDot`, `ImGuiKnobVariant_Stepped`, `ImGuiKnobVariant_Space`.\n\n### Flags\n - `ImGuiKnobFlags_NoTitle`: Hide the top title.\n - `ImGuiKnobFlags_NoInput`: Hide the bottom drag input.\n - `ImGuiKnobFlags_ValueTooltip`: Show a tooltip with the current value on hover.\n - `ImGuiKnobFlags_DragHorizontal`: Use horizontal dragging only (default is bi-directional).\n - `ImGuiKnobFlags_DragVertical`: Use vertical dragging only (default is bi-directional).\n - `ImGuiKnobFlags_AlwaysClamp`: Clamp input values that the user types into the input field. If not set, it's possible to override the min/max range via the input field.\n - `ImGuiKnobFlags_Logarithmic`: Use logarithmic scale for the knob (otherwise linear).\n\n### Size\nYou can specify a size given as the width of the knob (will be scaled according to ImGui's `FontGlobalScale`). Default (0) will use 4x line height.\n\n### Colors\nBy default the knobs are styled using colors from the imgui theme. You can push/pop style colors to change individual colors. The color ids/flags default to button colors, thus:\n\n| ImGui Color | Knob meaning |\n|---|---|\n| `ImGuiCol_ButtonActive` | The \"filled\" part |\n| `ImGuiCol_ButtonHovered` | The \"filled\" part, when hovered |\n| `ImGuiCol_Button` | The knob track |\n\nUse `ImGuiCol_FrameBg`/`ImGuiCol_Text` to change the input field colors.\n\n### Steps\nSteps determines the number of steps draw, it is only used for the `ImGuiKnobVariant_Stepped` variant.\n","funding_links":[],"categories":["Uncategorized","C++"],"sub_categories":["Uncategorized"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faltschuler%2Fimgui-knobs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faltschuler%2Fimgui-knobs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faltschuler%2Fimgui-knobs/lists"}