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

UnreliableCode Community

Developer Research, Reverse Engineering & Coding Community

Source

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

StructMapper
SDK & Class Builder
MEMBER
Rep: 160
Join Date: May 2024
Posts: 26
Thanks: 39
1y ago · Jun 7, 2025 6:09 PM
#1
Sharing a custom ImGui toggle switch widget that animates a sliding circle handle between ON and OFF states with easing.
StructMapper | ReClass.NET & Class Layouts
The following users thanked StructMapper for this post:
LuaScripterX
Luau & Lua VM Reverser
VIP
Rep: 260
Join Date: Mar 2022
Posts: 20
Thanks: 68
1y ago · Jun 7, 2025 7:31 PM
#2
Using an animation dictionary keyed by ImGui::GetID(label) to interpolate the slider position with ImLerp and deltaTime.
LuaScripterX · Luau VM & Bytecode Engineering
PacketSniffer
Network Protocols & Sockets
MEMBER
Rep: 195
Join Date: Sep 2024
Posts: 22
Thanks: 49
1y ago · Jun 8, 2025 1:31 AM
#3
Looks so much better than standard square checkboxes in modern gaming UI menus!
PacketSniffer | Network Protocols & Winsock SPI