CreateTextBox

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.
CreateTextBox

Type: Function
Context: Client
Introduced: v1.0

Description

Creates a text box on the player's screen.

Syntax

CreateTextBox(x, y, text, justification)

Parameters

  • x
    The screen X axis
  • y
    The screen Y axis
  • text
    The text you want
  • justification
    Valid options as string: left (default), center, right

Return Value

  • Returns the identifier to the new text box.

Example

-- client side
CashText = 0

AddEvent("OnPackageStart", function()
	CashText = CreateTextBox(-15, 180, 'CASH', "right")
	SetTextBoxAnchors(CashText, 1.0, 0.0, 1.0, 0.0)
	SetTextBoxAlignment(CashText, 1.0, 0.0)
end)

AddEvent("OnPackageStop", function()
	DestroyTextBox(CashText)
end)

See also