The console widget provides a scrollable, terminal-style text pane that is useful for displaying real-time log output, debug information, or any stream of text lines. Text is appended with aDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/DRESsedAlarm184/LWXGL/llms.txt
Use this file to discover all available pages before exploring further.
printf-style interface, the view auto-scrolls to the bottom when new content arrives (provided the user has not scrolled up), and a scroll position overlay is shown on hover.
The widget auto-sizes itself from the cols and rows parameters, eliminating manual pixel arithmetic.
Dimensions
The pixel size of the console is computed automatically from the column and row counts:Color Parameters
Bothcon_clr and txt_clr are packed color integers:
| Parameter | Low nibble | High nibble |
|---|---|---|
con_clr | Console background fill | Console border / scrollbar thumb fill |
txt_clr | Scrollbar fill (used for hover overlay background) | Text color |
Character Rendering
- Characters in the range 27–126 are rendered as-is.
- Tab characters (
\t) are expanded to 4 spaces before rendering. - Newline characters (
\n) advance to the next line. - Any other byte (outside 27–126 and not
\nor\t) is replaced with?.
Scroll Behavior
| Action | Effect |
|---|---|
| Mouse wheel up (button 4) | Scroll up 3 lines. |
| Mouse wheel down (button 5) | Scroll down 3 lines. |
| Space key (while hovering) | Jump to the bottom (last page). |
ConsolePrint / new content | Auto-scroll to bottom if the view was already at the bottom before the print. |
Viewing: start - end / total and Scroll: N%) is drawn over the console when the mouse pointer is inside the element.
Functions
CreateConsole
Creates a scrollable console widget.Unique integer identifier for this element.
Left edge of the console widget in pixels.
Top edge of the console widget in pixels.
Number of character columns visible at once. The pixel width is computed as
cols * 9 + 17. Lines longer than cols characters are wrapped automatically.Number of text rows visible at once. The pixel height is computed as
rows * 15 + 10.Packed color for the console pane itself. Low nibble = background fill; high nibble = border and scrollbar thumb color.
Packed color for text. Low nibble = scrollbar/hover-overlay background; high nibble = text foreground color.
ConsolePrint
Appends formatted text to the console’s internal buffer usingprintf-style format strings. If the view was already scrolled to the bottom before this call, it auto-scrolls to keep the latest content visible.
The identifier of the console element to print to.
A
printf-compatible format string. The formatted output is appended verbatim to the internal std::string buffer. Include \n to start a new line.Additional arguments matched to format specifiers in
format, following the same rules as printf.ConsoleClear
Clears all text from the console buffer and resets the scroll position to the top.The identifier of the console element to clear.