Home / Forums / How to handle text clipping and auto-scroll in custom Dear ImGui log consoles? [Discussion #3]

UnreliableCode Community

Developer Research, Reverse Engineering & Coding Community

Question

How to handle text clipping and auto-scroll in custom Dear ImGui log consoles? [Discussion #3]

ImGuiArtist
Modern UI Designer
MEMBER
Rep: 227
Join Date: Dec 2025
Posts: 6
Thanks: 63
1y ago · Nov 13, 2024 2:42 PM
#1
I am building an in-game debug console in Dear ImGui. How can I implement smooth auto-scrolling to the bottom when new logs arrive, while allowing the user to scroll up without fighting the view?
ImGuiArtist · Modern UI Designer
Dark glassmorphism, animated sliders, and custom font render...
The following users thanked ImGuiArtist for this post:
GenericGuru
Templates & Generics
MEMBER
Rep: 154
Join Date: Apr 2023
Posts: 8
Thanks: 35
1y ago · Nov 13, 2024 6:47 PM
#2
Check ImGui::GetScrollY() >= ImGui::GetScrollMaxY() before adding new items! If the user was already at the bottom, call ImGui::SetScrollHereY(1.0f) after rendering the new log entries. If the user scrolled up to inspect previous logs, skip the SetScrollHereY call so the view stays fixed.
GenericGuru · Templates & Generics
Curiously Recurring Template Pattern (CRTP), C++ concepts, a...
BinaryParser
File Format Reverser
MEMBER
Rep: 128
Join Date: Nov 2024
Posts: 6
Thanks: 78
1y ago · Nov 13, 2024 8:47 PM
#3
Also use ImGuiListClipper for large log lists (10,000+ items)! It only renders the visible lines on screen, preventing framerate drops.
BinaryParser · File Format Reverser
Parsing custom binary asset formats, mesh chunks, and compre...