DrawText
This function was added in DSL 1
Description
Draws text on the screen in normalized coordinates.
The text is drawn at the top-center of the screen by default, but can be positioned using the SetTextPosition
. The text is rendered using the current font set by SetTextFont
.
The function returns the width and height of the drawn text in normalized coordinates, which can be used for further positioning or layout calculations.
function DrawText(text) --[[ ... ]] end
Parameters
text
:string
- The text to draw on the screen.
Return Values
width
:number
- The width of the drawn text in normalized coordinates.height
:number
- The height of the drawn text in normalized coordinates.
Example
local width, height = DrawText('Hello, world!')