Documentation / device / DrawText
Class: DrawText
Defined in: libs/device/src/helpers/drawtext.ts:31
Helper class to draw some text onto the screen
Constructors
Constructor
new DrawText():
DrawText
Returns
DrawText
Methods
setFont()
staticsetFont(device,name):void
Defined in: libs/device/src/helpers/drawtext.ts:82
Set the font that will be used to draw strings
Parameters
device
The render device
name
string
The font name
Returns
void
setRenderStates()
staticsetRenderStates(renderStates):void
Defined in: libs/device/src/helpers/drawtext.ts:90
Set render states to be used when drawing text. If not set, default states will be used.
Parameters
renderStates
The render states to use when drawing text. If null, default states will be used.
Returns
void
drawText()
Call Signature
staticdrawText(device,text,color,x,y):void
Defined in: libs/device/src/helpers/drawtext.ts:101
Draw text onto the screen
Parameters
device
The render device
text
string
The text to be drawn
color
string | Vector4 | Vector3
The text color
x
number
X coordinate of the text
y
number
Y coordinate of the text
Returns
void
Call Signature
staticdrawText(device,text,color,rect,options?):void
Defined in: libs/device/src/helpers/drawtext.ts:116
Draw text inside a rectangle with layout and clipping
Parameters
device
The render device
text
string
The text to be drawn
color
string | Vector4 | Vector3
The text color
rect
Immutable<Rect>
The layout rectangle
options?
Layout options
Returns
void