D3d.DrawText

From Nomad DB
Revision as of 11:13, 15 April 2021 by Administrator (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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

Related Pages