muteki
Loading...
Searching...
No Matches
canvas.h File Reference

Display canvas (LCD) API. More...

#include <muteki/ui/common.h>

Go to the source code of this file.

Functions

short GetFontType (void)
 Get the current font type.
 
void SetFontType (short font_type)
 Set the current font type to font_type.
 
void WriteAlignString (short x, short y, const void *s, short max_length, int align, unsigned int flags)
 Draw a string s with specified alignment at (x, y) px.
 
void WriteChar (short x, short y, UTF16 c, unsigned int flags)
 Draw a UTF-16 character c aligned to the top left corner at (x, y) px.
 
void WriteString (short x, short y, const void *s, unsigned int flags)
 Draw a string s aligned to the top left corner at (x, y) px.
 
void Printf (const char *format,...) SYS_IS_PRINTF(1
 Format and draw a string.
 
void void PrintfXY (short x, short y, const char *format,...) SYS_IS_PRINTF(3
 Format and draw a string aligned to the top left corner at (x, y) px.
 
void void int ShowGraphic (short x, short y, lcd_surface_t *surface, unsigned short flags)
 Draw a surface onto current active LCD.
 
unsigned int SetCursorSize (unsigned int new_size)
 Set the size of the cursor on the current canvas.
 
unsigned int GetCursorSize (void)
 Get the size of the cursor on the current canvas.
 
void SetCursorPosition (short x, short y)
 Move the cursor position on the current canvas to the specified coordinate.
 
void GetCursorPosition (short *x, short *y)
 Get the cursor position on the current canvas.
 
short SetCursorType (short new_type)
 Set the type of the cursor on the current canvas.
 
short GetCursorType (void)
 Get the type of the cursor on the current canvas.
 
void CursorLock (void)
 Lock the cursor on the current canvas.
 
void CursorUnlock (void)
 Unlock the cursor on the current canvas.
 
int SetTransparentColor (int color)
 Set display canvas transparent color.
 
int rgbSetBkColor (int color)
 Set display canvas background fill color.
 
int rgbSetColor (int color)
 Set display canvas foreground fill color.
 
short SetPenStyle (short dash, unsigned int *dash_pattern)
 Set the stroke dash pattern.
 
short GetPenStyle (unsigned int *dash_pattern)
 Get the stroke dash pattern.
 
short GetPenSize (void)
 Get the stroke width.
 
short SetPenSize (short size)
 Set the stroke width.
 
int GetPixel (short x, short y)
 Get the RGB value of a pixel on the current active surface.
 
int SetPixel (short x, short y, int color)
 Set the pixel color on the current active surface with the given pixel.
 
size_t GetImage (short x0, short y0, short x1, short y1, lcd_surface_t *surface)
 Copy a rectangle of pixels from current active LCD and save it to the specified buffer.
 
void PutImage (short x, short y, lcd_surface_t *surface, unsigned short flags)
 Copy pixels from a surface to current active LCD.
 
void SetDrawArea (short x0, short y0, short x1, short y1)
 Set the drawing area of the current active LCD.
 
void GetDrawArea (short *x0, short *y0, short *x1, short *y1)
 Get the drawing area of the current active LCD.
 
void DrawLine (short x0, short y0, short x1, short y1, unsigned int flags)
 Stroke a line on the current active LCD.
 
void DrawRect (short x0, short y0, short x1, short y1, unsigned int flags)
 Stroke a rectangle on the current active LCD.
 
void FillRect (short x0, short y0, short x1, short y1, unsigned int flags)
 Fill a rectangle on the current active LCD.
 
void DrawRoundRect (short x0, short y0, short x1, short y1, short rx, short ry, unsigned int flags)
 Stroke a rounded corner rectangle on the current active LCD.
 
void DrawCircle (short x, short y, short r, unsigned int flags)
 Stroke a circle on the current active LCD.
 
void FillCircle (short x, short y, short r, unsigned int flags)
 Fill a circle on the current active LCD.
 
void DrawEllipse (short x, short y, short rx, short ry, unsigned int flags)
 Stroke an ellipse on the current active LCD.
 
void FillEllipse (short x, short y, short rx, short ry, unsigned int flags)
 Fill an ellipse on the current active LCD.
 
void InverseSetArea (short x0, short y0, short x1, short y1)
 Invert color within a rectangle.
 
void ClearScreen (bool fill_with_fg)
 Fill the current display canvas with background color, effectively clearing it.
 
void ScrollDown (short x0, short y0, short x1, short y1, short amount)
 Move a rectangle down by amount pixels.
 
void ScrollLeft (short x0, short y0, short x1, short y1, short amount)
 Move a rectangle left by amount pixels.
 
void ScrollRight (short x0, short y0, short x1, short y1, short amount)
 Move a rectangle right by amount pixels.
 
void ScrollUp (short x0, short y0, short x1, short y1, short amount)
 Move a rectangle up by amount pixels.
 
lcd_tCreateVirtualLCD (short width, short height, short width_bytes)
 Create a virtual LCD descriptor.
 
void DeleteVirtualLCD (lcd_t *lcd)
 Dispose a previously created virtual LCD descriptor.
 
lcd_tSetActiveLCD (lcd_t *new_lcd)
 Set an LCD descriptor as active.
 
lcd_tGetActiveLCD (void)
 Get the current active LCD descriptor.
 
lcd_tCreateCompatibleLCD (lcd_t *source)
 Copy an LCD descriptor (excluding surface).
 
lcd_surface_tSetDCObject (lcd_t *lcd, lcd_surface_t *new_surface)
 Link a surface (device context) to an LCD descriptor.
 
short GetMaxScrX (void)
 Get X coordinate of the rightmost visible pixels on the current canvas.
 
short GetMaxScrY (void)
 Get Y coordinate of the bottom-most visible pixels on the current canvas.
 

Detailed Description

Display canvas (LCD) API.

Note that the term "display canvas", "canvas" and "LCD" may be used interchangeably below. This may get rectified in a future release.

Function Documentation

◆ ClearScreen()

void ClearScreen ( bool  fill_with_fg)
extern

Fill the current display canvas with background color, effectively clearing it.

Syscall Number
0x1007e
Parameters
fill_with_fgFill with foreground color instead of background color.

Returns
None.

◆ CreateCompatibleLCD()

lcd_t * CreateCompatibleLCD ( lcd_t source)
extern

Copy an LCD descriptor (excluding surface).

This function allocates a new LCD descriptor and copies everything from the source descriptor to the new one. The new descriptor will not be linked to the source descriptor's lcd_t::surface, and lcd_t::saved_cursor will be updated to the latest cursor states assigned to the current active LCD descriptor. If the target platform supports LCD descriptor locking, a new critical section object will be created for the new descriptor.

Warning
The new descriptor will not have any surface linked to it by default. It is required to manually link a surface to it with e.g. SetDCObject() before using it to draw or things will break!
Syscall Number
0x1008e
Parameters
sourceThe source LCD descriptor.
Returns
The new LCD descriptor copied from the source descriptor.

◆ CreateVirtualLCD()

lcd_t * CreateVirtualLCD ( short  width,
short  height,
short  width_bytes 
)
extern

Create a virtual LCD descriptor.

Virtual LCDs allow the program to draw using the LCD/canvas API without committing the pixels to the screen immediately.

Syscall Number
0x10087
Parameters
widthWidth of the virtual LCD.
heightHeight of the virtual LCD.
width_bytesIf set to a value larger than the value calculated from width, the pixel buffer will be allocated according to this value instead (i.e. width_bytes * height).
Returns
The virtual LCD descriptor.

◆ CursorLock()

void CursorLock ( void  )
extern

Lock the cursor on the current canvas.

Syscall Number
0x10063

Parameters
None.
Returns
None.

◆ CursorUnlock()

void CursorUnlock ( void  )
extern

Unlock the cursor on the current canvas.

Syscall Number
0x10064

Parameters
None.
Returns
None.

◆ DeleteVirtualLCD()

void DeleteVirtualLCD ( lcd_t lcd)
extern

Dispose a previously created virtual LCD descriptor.

Syscall Number
0x10088
Parameters
lcdPointer to a virtual LCD descriptor.

Returns
None.

◆ DrawCircle()

void DrawCircle ( short  x,
short  y,
short  r,
unsigned int  flags 
)
extern

Stroke a circle on the current active LCD.

Syscall Number
0x10079
Parameters
xX coordinate of the center.
yY coordinate of the center.
rRadius of the circle.
flagsBlit processing flags.

Returns
None.

◆ DrawEllipse()

void DrawEllipse ( short  x,
short  y,
short  rx,
short  ry,
unsigned int  flags 
)
extern

Stroke an ellipse on the current active LCD.

Syscall Number
0x1007b
Parameters
xX coordinate of the center.
yY coordinate of the center.
rxHorizontal radius of the ellipse.
ryVertical radius of the ellipse.
flagsBlit processing flags.

Returns
None.

◆ DrawLine()

void DrawLine ( short  x0,
short  y0,
short  x1,
short  y1,
unsigned int  flags 
)
extern

Stroke a line on the current active LCD.

Syscall Number
0x10075
Parameters
x0X coordinate of the first point.
y0Y coordinate of the first point.
x1X coordinate of the second point.
y1Y coordinate of the second point.
flagsBlit processing flags.

Returns
None.

◆ DrawRect()

void DrawRect ( short  x0,
short  y0,
short  x1,
short  y1,
unsigned int  flags 
)
extern

Stroke a rectangle on the current active LCD.

Syscall Number
0x10076
Parameters
x0X coordinate of the top-left corner, in pixels (inclusive).
y0Y coordinate of the top-left corner, in pixels (inclusive).
x1X coordinate of the bottom-right corner, in pixels (inclusive).
y1Y coordinate of the bottom-right corner, in pixels (inclusive).
flagsBlit processing flags.

Returns
None.

◆ DrawRoundRect()

void DrawRoundRect ( short  x0,
short  y0,
short  x1,
short  y1,
short  rx,
short  ry,
unsigned int  flags 
)
extern

Stroke a rounded corner rectangle on the current active LCD.

Syscall Number
0x10078
Parameters
x0X coordinate of the top-left corner, in pixels (inclusive).
y0Y coordinate of the top-left corner, in pixels (inclusive).
x1X coordinate of the bottom-right corner, in pixels (inclusive).
y1Y coordinate of the bottom-right corner, in pixels (inclusive).
rxHorizontal radius in pixels.
ryVertical radius in pixels.
flagsBlit processing flags.

Returns
None.

◆ FillCircle()

void FillCircle ( short  x,
short  y,
short  r,
unsigned int  flags 
)
extern

Fill a circle on the current active LCD.

Warning
This does not seem to actually fill the circle. Use FillEllipse() instead.
Syscall Number
0x1007a
Parameters
xX coordinate of the center.
yY coordinate of the center.
rRadius of the circle.
flagsBlit processing flags.

Returns
None.

◆ FillEllipse()

void FillEllipse ( short  x,
short  y,
short  rx,
short  ry,
unsigned int  flags 
)
extern

Fill an ellipse on the current active LCD.

Syscall Number
0x1007c
Parameters
xX coordinate of the center.
yY coordinate of the center.
rxHorizontal radius of the ellipse.
ryVertical radius of the ellipse.
flagsBlit processing flags.

Returns
None.

◆ FillRect()

void FillRect ( short  x0,
short  y0,
short  x1,
short  y1,
unsigned int  flags 
)
extern

Fill a rectangle on the current active LCD.

Syscall Number
0x10077
Parameters
x0X coordinate of the top-left corner, in pixels (inclusive).
y0Y coordinate of the top-left corner, in pixels (inclusive).
x1X coordinate of the bottom-right corner, in pixels (inclusive).
y1Y coordinate of the bottom-right corner, in pixels (inclusive).
flagsBlit processing flags.

Returns
None.

◆ GetActiveLCD()

lcd_t * GetActiveLCD ( void  )
extern

Get the current active LCD descriptor.

Syscall Number
0x1008d

Parameters
None.

Returns
The current active LCD descriptor.

◆ GetCursorPosition()

void GetCursorPosition ( short *  x,
short *  y 
)
extern

Get the cursor position on the current canvas.

Syscall Number
0x10060
Parameters
[out]xThe x coordinate of the cursor.
[out]yThe y coordinate of the cursor.

Returns
None.

◆ GetCursorSize()

unsigned int GetCursorSize ( void  )
extern

Get the size of the cursor on the current canvas.

Syscall Number
0x1005e

Parameters
None.

Returns
The cursor size.

◆ GetCursorType()

short GetCursorType ( void  )
extern

Get the type of the cursor on the current canvas.

Todo:
Document the actual type as an enum.
Syscall Number
0x10062

Parameters
None.

Returns
The cursor type.

◆ GetDrawArea()

void GetDrawArea ( short *  x0,
short *  y0,
short *  x1,
short *  y1 
)
extern

Get the drawing area of the current active LCD.

Syscall Number
0x10074
Parameters
[out]x0X coordinate of the top-left corner, in pixels (inclusive).
[out]y0Y coordinate of the top-left corner, in pixels (inclusive).
[out]x1X coordinate of the bottom-right corner, in pixels (inclusive).
[out]y1Y coordinate of the bottom-right corner, in pixels (inclusive).

Returns
None.

◆ GetFontType()

short GetFontType ( void  )
extern

Get the current font type.

Syscall Number
0x1004f

Parameters
None.

Returns
The current font type.
See also
font_type_e Valid values for font_type.

◆ GetImage()

size_t GetImage ( short  x0,
short  y0,
short  x1,
short  y1,
lcd_surface_t surface 
)
extern

Copy a rectangle of pixels from current active LCD and save it to the specified buffer.

This is similar to using _BitBlt() on the active LCD surface but with a seemingly different implementation and a different function signature. Surface initialization is done implicitly by this function although calling GetImageSize() in user code is still required in order to allocate a buffer of appropriate size.

Syscall Number
0x10071
Parameters
x0X coordinate of the top-left corner, in pixels (inclusive).
y0Y coordinate of the top-left corner, in pixels (inclusive).
x1X coordinate of the bottom-right corner, in pixels (inclusive).
y1Y coordinate of the bottom-right corner, in pixels (inclusive).
surfaceTarget buffer that will hold the surface.
Returns
Size of the surface.

◆ GetMaxScrX()

short GetMaxScrX ( void  )
extern

Get X coordinate of the rightmost visible pixels on the current canvas.

This is usually tied to the physical resolution of the display. Therefore it can be used to determine the display size. The display size can be calculated by adding 1 to the return values of both GetMaxScr* calls.

Syscall Number
0x10190

Parameters
None.

Returns
The X coordinate of the rightmost visible pixels.
See also
GetMaxScrY Returns the Y boundary instead.

◆ GetMaxScrY()

short GetMaxScrY ( void  )
extern

Get Y coordinate of the bottom-most visible pixels on the current canvas.

This is usually tied to the physical resolution of the display. Therefore it can be used to determine the display size. The display size can be calculated by adding 1 to the return values of both GetMaxScr* calls.

Syscall Number
0x10191

Parameters
None.

Returns
The Y coordinate of the bottom-most visible pixels.
See also
GetMaxScrX Returns the X boundary instead.

◆ GetPenSize()

short GetPenSize ( void  )

Get the stroke width.

Syscall Number
0x1006d

Parameters
None.

Returns
Current stroke width in pixels.

◆ GetPenStyle()

short GetPenStyle ( unsigned int *  dash_pattern)

Get the stroke dash pattern.

Syscall Number
0x1006c
Parameters
[out]dash_patternIf not NULL, the current dash bit pattern.
Returns
The current predefined dash pattern.

◆ GetPixel()

int GetPixel ( short  x,
short  y 
)

Get the RGB value of a pixel on the current active surface.

Warning
This does not check for out-of-bound access.
Syscall Number
0x1006f
Parameters
xX coordinate.
yY coordinate.
Returns
The RGB color value

◆ InverseSetArea()

void InverseSetArea ( short  x0,
short  y0,
short  x1,
short  y1 
)
extern

Invert color within a rectangle.

Syscall Number
0x1007d
Parameters
x0X coordinate of the top-left corner, in pixels (inclusive).
y0Y coordinate of the top-left corner, in pixels (inclusive).
x1X coordinate of the bottom-right corner, in pixels (inclusive).
y1Y coordinate of the bottom-right corner, in pixels (inclusive).

Returns
None.

◆ Printf()

void Printf ( const char *  format,
  ... 
)
extern

Format and draw a string.

Handles line wraps and screen scrolling automatically.

Syscall Number
0x10057
Parameters
formatThe format string.
...Any subsequent values.

Returns
None.

◆ PrintfXY()

void void PrintfXY ( short  x,
short  y,
const char *  format,
  ... 
)
extern

Format and draw a string aligned to the top left corner at (x, y) px.

Syscall Number
0x10058
Parameters
xX coordinate of the corner.
yY coordinate of the corner.
formatThe format string passed to the built-in sprintf().
...Any subsequent values passed to the built-in sprintf().

Returns
None.

◆ PutImage()

void PutImage ( short  x,
short  y,
lcd_surface_t surface,
unsigned short  flags 
)
extern

Copy pixels from a surface to current active LCD.

This is very similar to ShowGraphic() except that it does not check whether or not surface is NULL and there is no indication of whether or not the process was completed successfully.

Syscall Number
0x10072
Parameters
xX coordinate.
yY coordinate.
surfaceThe surface descriptor.
flagsProcessing flags.

Returns
None.

See also
blit_flag_e Accepted processing flags.
ShowGraphic A function that pretty much does the same thing but with NULL check and a return value.

◆ rgbSetBkColor()

int rgbSetBkColor ( int  color)
extern

Set display canvas background fill color.

Syscall Number
0x10067
Parameters
colorThe integer RGB value representing a new color.
Returns
The integer RGB value representing the old color.

◆ rgbSetColor()

int rgbSetColor ( int  color)
extern

Set display canvas foreground fill color.

Syscall Number
0x10068
Parameters
colorThe integer RGB value representing a new color.
Returns
The integer RGB value representing the old color.

◆ ScrollDown()

void ScrollDown ( short  x0,
short  y0,
short  x1,
short  y1,
short  amount 
)
extern

Move a rectangle down by amount pixels.

Syscall Number
0x10080
Parameters
x0X coordinate of the top-left corner, in pixels (inclusive).
y0Y coordinate of the top-left corner, in pixels (inclusive).
x1X coordinate of the bottom-right corner, in pixels (inclusive).
y1Y coordinate of the bottom-right corner, in pixels (inclusive).
amountAmount of pixels to move.

Returns
None.

◆ ScrollLeft()

void ScrollLeft ( short  x0,
short  y0,
short  x1,
short  y1,
short  amount 
)
extern

Move a rectangle left by amount pixels.

Syscall Number
0x10081
Parameters
x0X coordinate of the top-left corner, in pixels (inclusive).
y0Y coordinate of the top-left corner, in pixels (inclusive).
x1X coordinate of the bottom-right corner, in pixels (inclusive).
y1Y coordinate of the bottom-right corner, in pixels (inclusive).
amountAmount of pixels to move.

Returns
None.

◆ ScrollRight()

void ScrollRight ( short  x0,
short  y0,
short  x1,
short  y1,
short  amount 
)
extern

Move a rectangle right by amount pixels.

Syscall Number
0x10082
Parameters
x0X coordinate of the top-left corner, in pixels (inclusive).
y0Y coordinate of the top-left corner, in pixels (inclusive).
x1X coordinate of the bottom-right corner, in pixels (inclusive).
y1Y coordinate of the bottom-right corner, in pixels (inclusive).
amountAmount of pixels to move.

Returns
None.

◆ ScrollUp()

void ScrollUp ( short  x0,
short  y0,
short  x1,
short  y1,
short  amount 
)
extern

Move a rectangle up by amount pixels.

Syscall Number
0x10083
Parameters
x0X coordinate of the top-left corner, in pixels (inclusive).
y0Y coordinate of the top-left corner, in pixels (inclusive).
x1X coordinate of the bottom-right corner, in pixels (inclusive).
y1Y coordinate of the bottom-right corner, in pixels (inclusive).
amountAmount of pixels to move.

Returns
None.

◆ SetActiveLCD()

lcd_t * SetActiveLCD ( lcd_t new_lcd)
extern

Set an LCD descriptor as active.

Syscall Number
0x1008b
Parameters
new_lcdPointer to the new LCD descriptor. If NULL, only return the current active LCD descriptor.
Returns
The active LCD descriptor before new_lcd replaced it.

◆ SetCursorPosition()

void SetCursorPosition ( short  x,
short  y 
)
extern

Move the cursor position on the current canvas to the specified coordinate.

Syscall Number
0x1005f
Parameters
xThe new x coordinate of the cursor.
yThe new y coordinate of the cursor.

Returns
None.

◆ SetCursorSize()

unsigned int SetCursorSize ( unsigned int  new_size)
extern

Set the size of the cursor on the current canvas.

Syscall Number
0x1005d
Parameters
new_sizeThe new cursor size.
Returns
The previous cursor size.

◆ SetCursorType()

short SetCursorType ( short  new_type)
extern

Set the type of the cursor on the current canvas.

Todo:
Document the actual type as an enum.
Syscall Number
0x10061
Parameters
new_typeThe new cursor type.
Returns
The previous cursor type.

◆ SetDCObject()

lcd_surface_t * SetDCObject ( lcd_t lcd,
lcd_surface_t new_surface 
)
extern

Link a surface (device context) to an LCD descriptor.

The drawing area lcd_t::drawing_area will also be reset to cover the entire surface.

If the display is portrait as indicated by the lcd_t::rotation value, the LCD descriptor's width/height fields will be updated to reflect the dimension shown to the user (i.e. swap width and height).

Syscall Number
0x10093
Parameters
lcdThe LCD descriptor.
new_surfaceThe descriptor of the new surface to be linked to lcd.
Returns
The descriptor of the surface previously linked to lcd.

◆ SetDrawArea()

void SetDrawArea ( short  x0,
short  y0,
short  x1,
short  y1 
)
extern

Set the drawing area of the current active LCD.

The new values will be rejected if they are out of bounds (specifically when x0 or x1 are negative or x1 or y1 are less than x0 and y0 respectively), although x1 and y1 will be automatically capped at the physical display size if they are larger than that instead of failing outright.

Syscall Number
0x10073
Parameters
x0X coordinate of the top-left corner, in pixels (inclusive).
y0Y coordinate of the top-left corner, in pixels (inclusive).
x1X coordinate of the bottom-right corner, in pixels (inclusive).
y1Y coordinate of the bottom-right corner, in pixels (inclusive).

Returns
None.

◆ SetFontType()

void SetFontType ( short  font_type)
extern

Set the current font type to font_type.

Syscall Number
0x10051
Parameters
font_typeThe font type.

Returns
None.

See also
font_type_e Valid values for font_type.

◆ SetPenSize()

short SetPenSize ( short  size)

Set the stroke width.

Syscall Number
0x1006e
Parameters
sizeNew stroke width in pixels.
Returns
Previous stroke width in pixels.

◆ SetPenStyle()

short SetPenStyle ( short  dash,
unsigned int *  dash_pattern 
)

Set the stroke dash pattern.

The dash bit patterns are simple 32-bit bitfields (in big endian). Each bit 1 represents a foreground colored pixel and bit 0 represents a background pixel, from left to right, MSB to LSB. For example, stroke-dasharray 1 7 4 4 2 6 4 4 can be encoded as 10000000111100001100000011110000. With endian swapped, the final dash_pattern would be 0xf0c0f080.

Note
Stroke dash pattern set via this function does not apply to curves.
Syscall Number
0x1006b
Parameters
dashNew predefined dash pattern. Set to DASH_CUSTOM to specify a custom pattern.
[in,out]dash_patternNew dash bit pattern. Will be set to the previous dash bit pattern once this function returns.
Returns
Previous predefined dash pattern.

◆ SetPixel()

int SetPixel ( short  x,
short  y,
int  color 
)

Set the pixel color on the current active surface with the given pixel.

When the surface uses indexed color, the color that is the closest to the palette will be picked.

Warning
This does not check for out-of-bound access.
Syscall Number
0x10070
Parameters
xX coordinate.
yY coordinate.
colorThe RGB color value.
Returns
The actual RGB color value being used.

◆ SetTransparentColor()

int SetTransparentColor ( int  color)
extern

Set display canvas transparent color.

This color will be removed from the image and replaced with transparency effect.

Syscall Number
0x10065
Parameters
colorThe integer RGB value representing a new color.
Returns
The integer RGB value representing the old color.

◆ ShowGraphic()

void void int ShowGraphic ( short  x,
short  y,
lcd_surface_t surface,
unsigned short  flags 
)
extern

Draw a surface onto current active LCD.

If surface is set to NULL this will fail gracefully.

Syscall Number
0x10059
Parameters
xX coordinate.
yY coordinate.
surfaceThe surface descriptor.
flagsProcessing flags.
Return values
0The operation was completed successfully.
-1The operation failed with error.
See also
blit_flag_e Accepted processing flags.
PutImage A simplified version of this function.

◆ WriteAlignString()

void WriteAlignString ( short  x,
short  y,
const void *  s,
short  max_length,
int  align,
unsigned int  flags 
)
extern

Draw a string s with specified alignment at (x, y) px.

The anchor point will be located at the top of the string to be drawn. The align parameter then controls whether the anchor point will be at the left, center or right of the string.

If the string is too long, it will be truncated to max_length. After truncation, the last few characters may get replaced with ... depending on the font selection.

Syscall Number
0x10052
Parameters
xX coordinate of the anchor point.
yY coordinate of the anchor point.
sString to be drawn. Exact encoding depends on the process flags being used.
max_lengthThe maximum length of the string in pixels.
alignString alignment.
flagsString processing flags
See also
print_flag_e Valid process flags.
print_str_flag_e Encoding conversion flags.

◆ WriteChar()

void WriteChar ( short  x,
short  y,
UTF16  c,
unsigned int  flags 
)
extern

Draw a UTF-16 character c aligned to the top left corner at (x, y) px.

Syscall Number
0x10053
Parameters
xX coordinate of the corner.
yY coordinate of the corner.
cUTF-16 codepoint of the character.
flagsProcess flags.

Returns
None.

See also
print_flag_e Valid process flags.

◆ WriteString()

void WriteString ( short  x,
short  y,
const void *  s,
unsigned int  flags 
)
extern

Draw a string s aligned to the top left corner at (x, y) px.

Syscall Number
0x10054
Parameters
xX coordinate of the corner.
yY coordinate of the corner.
[in]sString to be drawn. Exact encoding depends on the process flags being used.
flagsProcess flags.

Returns
None.

See also
WriteChar Similar function that displays single characters instead.
print_flag_e Valid process flags.
print_str_flag_e Encoding conversion flags.