libnds
Loading...
Searching...
No Matches
Data Fields
PrintConsole Struct Reference

Console structure used to store the state of a console render context. More...

#include <console.h>

Data Fields

int bgId
 Background ID. Initialized by consoleInit().
 
u16 consoleHeight
 Height of the console hardware layer in tiles.
 
u16 consoleWidth
 Width of the console hardware layer in tiles.
 
s16 cursorX
 Current X location of the cursor. Initialized by consoleInit().
 
s16 cursorY
 Current Y location of the cursor. Initialized by consoleInit().
 
ConsoleFont font
 Font of the console.
 
u16fontBgGfx
 Pointer to the bg layer graphics if used. Initialized by consoleInit().
 
u16fontBgMap
 Pointer to the bg layer map if used. Initialized by consoleInit().
 
u16 fontCharOffset
 Offset to the first graphics tile in background memory (in case your font is not loaded at a graphics base boundary). Initialized by consoleInit().
 
u16 fontCurPal
 The current palette used by the engine. Initialized by consoleInit().
 
u8 fontPalIndex
 Palette index where a custom palette is loaded. Initialized by consoleInit().
 
s16 prevCursorX
 Internal. Used by "\x1b[s" and "\x1b[u". Initialized by consoleInit().
 
s16 prevCursorY
 Internal. Used by "\x1b[s" and "\x1b[u". Initialized by consoleInit().
 
ConsolePrint PrintChar
 Callback for printing a character.
 
u8 tabSize
 Size of a TAB character.
 
u16 windowHeight
 Window height in tiles.
 
u16 windowWidth
 Window width in tiles.
 
u16 windowX
 Window X location in tiles.
 
u16 windowY
 Window Y location in tiles.
 

Detailed Description

Console structure used to store the state of a console render context.

Many of the values in this struct are actually initialized by libnds, and the user should leave them as 0 when consoleInit() is called.

Default values from consoleGetDefault():

PrintConsole defaultConsole =
{
.font =
{
.gfx = default_fontTiles, // Font tiles
.pal = NULL, // No font palette (use the default palettes)
.numColors = 0,
.bpp = 1,
.asciiOffset = 32, // First ASCII character in the set
.numChars = 96 // Number of characters in the font set
},
.consoleWidth = 32,
.consoleHeight = 24,
.windowX = 0,
.windowY = 0,
.windowWidth = 32,
.windowHeight = 24,
.tabSize = 3,
.PrintChar = NULL,
};
const void * gfx
Pointer to the font graphics.
Definition arm9/console.h:137
Console structure used to store the state of a console render context.
Definition arm9/console.h:196
ConsoleFont font
Font of the console.
Definition arm9/console.h:197

Field Documentation

◆ PrintChar

ConsolePrint PrintConsole::PrintChar

Callback for printing a character.

It should return true if it has handled rendering the graphics. If not, the print engine will attempt to render via tiles).


The documentation for this struct was generated from the following file: