The console element provides a self-contained, scrollable terminal window inside your LWXGL application. It acceptsDocumentation 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 formatted output through ConsolePrint, maintains an internal line buffer, renders the visible rows each frame, and handles mouse-wheel scrolling automatically when the cursor is over the element. Pressing Space while hovering the console jumps the view to the most recent output.
CreateConsole
cols * 9 + 17 pixels (9 px per character column plus a 17 px scrollbar gutter), height = rows * 15 + 10 pixels (15 px per character row plus 10 px of padding).
Unique element ID.
X coordinate of the console’s top-left corner in pixels.
Y coordinate of the console’s top-left corner in pixels.
Number of visible character columns. Determines the element width as
cols * 9 + 17.Number of visible text rows. Determines the element height as
rows * 15 + 10.Background fill color for the console panel — palette index (0–15) or
CLR_* constant.Text foreground color for all output lines — palette index (0–15) or
CLR_* constant.ConsolePrint
vasprintf (supporting the full printf format string syntax). If the scroll position was at the bottom before the new text arrived, the console automatically scrolls down to keep the newest content visible.
ID of an existing console element.
printf-style format string, followed by any required arguments.Each call appends to the existing buffer — newlines in the format string create new visible rows. There is no built-in line limit; the full history is retained in memory for the session.
ConsoleClear
ID of the console element to clear.
Automatic scrolling behavior
- Mouse-wheel over the console: LWXGL’s event handler automatically adjusts the console’s scroll offset when a scroll event occurs while the cursor is inside the element’s bounding box. No application code is required.
- Auto-scroll on new output: If the scroll position is at the bottom (i.e. the last line is visible) when
ConsolePrintis called, the console scrolls down to show the new content. If the user has scrolled up to review earlier output, the position is preserved. - Space to jump to bottom: Pressing Space while hovering the console instantly scrolls to the latest line.