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

UnreliableCode Community

Developer Research, Reverse Engineering & Coding Community

Source

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

SourceGenDev
C# Tooling
MEMBER
Rep: 158
Join Date: Jan 2020
Posts: 8
Thanks: 79
8mo ago · Dec 16, 2025 3:51 PM
#1
Sharing a custom ImGui toggle switch widget that animates a sliding circle handle between ON and OFF states with easing.
SourceGenDev · C# Tooling
Metaprogramming with C# 9+ Source Generators and Roslyn Anal...
The following users thanked SourceGenDev for this post:
CoroExplorer
C++20 Coroutines
MEMBER
Rep: 57
Join Date: May 2024
Posts: 6
Thanks: 49
8mo ago · Dec 16, 2025 5:04 PM
#2
Using an animation dictionary keyed by ImGui::GetID(label) to interpolate the slider position with ImLerp and deltaTime.
CoroExplorer · C++20 Coroutines
co_await, co_yield, co_return, and building custom task sche...
StructAligner
Data-Oriented Design
VIP
Rep: 301
Join Date: Dec 2025
Posts: 8
Thanks: 25
8mo ago · Dec 17, 2025 10:04 PM
#3
Looks so much better than standard square checkboxes in modern gaming UI menus!
StructAligner · Data-Oriented Design
Structure of Arrays (SoA) vs Array of Structures (AoS) for m...