DrawText

From Onset Developer Wiki
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
DrawText

Type: Function
Context: Client
Introduced: v1.0

Description

Draws a text on the player screen. The X and Y axis are the screen coordinates which start from upper-left corner instead of center.

Syntax

DrawText(x, y, text)

Parameters

  • x
    The X axis on the screen.
  • y
    The Y axis on the screen.
  • text
    The text you want to draw on the client screen.

Return Value

  • Returns nil.

Example

AddEvent("OnRenderHUD", function ()
	local w, h = GetScreenSize() -- Gets the screen size of the client
	DrawText(w / 2, h / 2, "Some text in the center of your screen!") -- Creates the text in the center of the client's screen
end)

See also