The console element is a scrollable text terminal widget — useful for in-app logs, debug output, or REPL-style displays. It maintains an internal text buffer, handles word-wrap at the column boundary, and draws a proportional scrollbar on its right edge.Documentation 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.
GCreateConsole
cols and rows:
- Width:
cols * 9 + 17px (9 px per character column + 17 px for the scrollbar area) - Height:
rows * 15 + 10px (15 px per row + 10 px padding)
Element slot index. If the slot is already occupied the existing element is deleted first.
Left edge of the console in window pixels.
Top edge of the console in window pixels.
Number of character columns visible at one time. Text longer than
cols characters on a single logical line is soft-wrapped onto the next visual line automatically.Number of visible text lines. Lines beyond
rows are accessible by scrolling.Packed color byte for the console widget. High nibble = border palette index, low nibble = background palette index. For example,
0x07 gives a white (7) border on a black (0) background.GConsolePrint
printf-style format strings. The rendered output is then available for display on the next GRenderWindow call.
Element slot index of an existing console element.
A
printf-compatible format string. The formatted result is capped at 1024 characters per call (including the null terminator).Optional arguments consumed by
format, following standard printf conventions.| Character | Behavior |
|---|---|
\n | Starts a new line. |
\t | Expanded to 4 spaces. |
| Printable ASCII (0x1B–0x7E) | Displayed as-is. |
| Any other byte | Displayed as ?. |
GConsoleClear
0, and resets the scroll position to the top.
Element slot index of an existing console element.
Scrolling
The console responds to user input automatically when the mouse cursor is inside its bounds:| Input | Effect |
|---|---|
| Scroll wheel up | Scroll up one line. |
| Scroll wheel down | Scroll down one line. |
| Space | Jump to the bottom (most recent output). |
max(9, (h - 6) * rows / total_lines) px, so it gives a visual indication of how much content is off-screen.