Torque2D Reference
Loading...
Searching...
No Matches

Functions

U32 dglDrawText (GFont *font, const Point2I &ptDraw, const UTF16 *in_string, const ColorI *colorTable=NULL, const U32 maxColorIndex=9, F32 rot=0.f)
U32 dglDrawText (GFont *font, const Point2I &ptDraw, const UTF8 *in_string, const ColorI *colorTable=NULL, const U32 maxColorIndex=9, F32 rot=0.f)
 Converts UTF8 text to UTF16, and calls the UTF16 version of dglDrawText.
U32 dglDrawTextN (GFont *font, const Point2I &ptDraw, const UTF16 *in_string, U32 n, const ColorI *colorTable=NULL, const U32 maxColorIndex=9, F32 rot=0.f)
U32 dglDrawTextN (GFont *font, const Point2I &ptDraw, const UTF8 *in_string, U32 n, const ColorI *colorTable=NULL, const U32 maxColorIndex=9, F32 rot=0.f)
 Converts UTF8 text to UTF16, and calls the UTF16 version of dglDrawTextN.

Detailed Description

These functions draw a string on the string with a given font

Function Documentation

◆ dglDrawText() [1/2]

U32 dglDrawText ( GFont * font,
const Point2I & ptDraw,
const UTF16 * in_string,
const ColorI * colorTable = NULL,
const U32 maxColorIndex = 9,
F32 rot = 0.f )

Draws text at a location in 2d gui coordinates Also supports color tags to modulate the given text

Returns
the number of x-pixels traversed
Parameters
fontfont to draw with, usually found in the profile
ptDrawpoint where to start drawing text
in_stringstring to be drawn
colorTablelookups for the color tags
maxColorIndexsize of the colorTable
rotrotation of text

◆ dglDrawText() [2/2]

U32 dglDrawText ( GFont * font,
const Point2I & ptDraw,
const UTF8 * in_string,
const ColorI * colorTable = NULL,
const U32 maxColorIndex = 9,
F32 rot = 0.f )

Converts UTF8 text to UTF16, and calls the UTF16 version of dglDrawText.

◆ dglDrawTextN() [1/2]

U32 dglDrawTextN ( GFont * font,
const Point2I & ptDraw,
const UTF16 * in_string,
U32 n,
const ColorI * colorTable = NULL,
const U32 maxColorIndex = 9,
F32 rot = 0.f )

Draws "n" number of characters from the string, in_string

Returns
the number of x-pixels traversed
See also
dglDrawText

◆ dglDrawTextN() [2/2]

U32 dglDrawTextN ( GFont * font,
const Point2I & ptDraw,
const UTF8 * in_string,
U32 n,
const ColorI * colorTable = NULL,
const U32 maxColorIndex = 9,
F32 rot = 0.f )

Converts UTF8 text to UTF16, and calls the UTF16 version of dglDrawTextN.