Difference between revisions of "D3d.DrawText"
From Nomad DB
(Created page with "Draws text onto the screen at the given position. Font is set using d3d.SetFont and the text color in d3d.SetColor. If you want to measure the text size before renderi...") |
(No difference)
|
Revision as of 22:17, 2 August 2020
Draws text onto the screen at the given position. Font is set using d3d.SetFont and the text color in d3d.SetColor. If you want to measure the text size before rendering, you can use d3d.MeasureText.
This function can only be called from inside OnRender event!
Syntax
d3d.DrawText(x, y, text)
- x, y: number (Position)
- text: string (Text)
Example
function script:OnRender()
d3d.SetColor(255, 0, 0) --red
d3d.SetFont("Arial", 20)
d3d.DrawText(50, 50, "Hello NomadDB!")
end