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

UnreliableCode Community

Developer Research, Reverse Engineering & Coding Community

Source

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

KernelDiver
Kernel & Systems Researcher
VIP
Rep: 275
Join Date: Jan 2024
Posts: 24
Thanks: 70
1y ago · Jun 16, 2025 11:45 AM
#1
Sharing a custom ImGui toggle switch widget that animates a sliding circle handle between ON and OFF states with easing.
KernelDiver · Windows Internals & Page Tables
The following users thanked KernelDiver for this post:
AsmDisasm
x86_64 Disassembler Dev
MEMBER
Rep: 145
Join Date: Feb 2025
Posts: 23
Thanks: 36
1y ago · Jun 16, 2025 2:09 PM
#2
Using an animation dictionary keyed by ImGui::GetID(label) to interpolate the slider position with ImLerp and deltaTime.
AsmDisasm · Zydis & Opcode Length Disassembly
OffsetHunter
RTTI & NetVar Dumper
MEMBER
Rep: 175
Join Date: Jul 2024
Posts: 20
Thanks: 44
1y ago · Jun 17, 2025 4:09 PM
#3
Looks so much better than standard square checkboxes in modern gaming UI menus!
OffsetHunter · RTTI TypeDescriptors & NetVars