Home / Forums / Creating Smooth Animated Toggle Switches in Dear ImGui [Discussion #6]

UnreliableCode Community

Developer Research, Reverse Engineering & Coding Community

Source

Creating Smooth Animated Toggle Switches in Dear ImGui [Discussion #6]

PixelCraft
ImGui UI Hacker
MEMBER
Rep: 344
Join Date: Mar 2022
Posts: 7
Thanks: 92
4y ago · Mar 16, 2022 1:18 PM
#1
Sharing a custom ImGui toggle switch widget that animates a sliding circle handle between ON and OFF states with easing.
PixelCraft · ImGui UI Hacker
Creating custom Dear ImGui themes, graphs, docking layouts, ...
The following users thanked PixelCraft for this post:
AsyncMaster
Concurrency Geek
MEMBER
Rep: 72
Join Date: Jul 2020
Posts: 13
Thanks: 83
4y ago · Mar 16, 2022 2:27 PM
#2
Using an animation dictionary keyed by ImGui::GetID(label) to interpolate the slider position with ImLerp and deltaTime.
AsyncMaster · Concurrency Geek
Task Parallel Library (TPL), async/await internals, and lock...
UI_Wizard
ImGui Widget Dev
MEMBER
Rep: 72
Join Date: Feb 2021
Posts: 6
Thanks: 95
4y ago · Mar 16, 2022 7:27 PM
#3
Looks so much better than standard square checkboxes in modern gaming UI menus!
UI_Wizard · ImGui Widget Dev
Writing complex custom ImGui widgets: color pickers, curve e...