ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Server functions
  3. textCreateTextItem

Function

textCreateTextItem

ServerText displaysIdentical to MTA:SA

Creates a text for a text display. The position is relative to the screen: 0 = left/top edge, 1 = right/bottom, so the text looks the same at any resolution. The text appears only after being added to a display.

Syntax

textitem textCreateTextItem(string text, float x, float y [, string priority = "medium", int r = 255, int g = 255, int b = 255, int a = 255, float scale = 1, string alignX = "left", string alignY = "top", int shadowAlpha = 0])

Arguments

textstring
The text.
xfloat
X position from 0 to 1.
yfloat
Y position from 0 to 1.
prioritystring, optional = "medium"
"low", "medium" or "high" - how fast changes reach players.
rint, optional = 255
Red.
gint, optional = 255
Green.
bint, optional = 255
Blue.
aint, optional = 255
Alpha.
scalefloat, optional = 1
Text scale.
alignXstring, optional = "left"
"left", "center" or "right".
alignYstring, optional = "top"
"top", "center" or "bottom".
shadowAlphaint, optional = 0
Shadow alpha (compatibility with existing scripts).

Returns

The new text item.

Example

local display = textCreateDisplay()
local timer = textCreateTextItem("60", 0.95, 0.05, "high", 255, 255, 255, 255, 2, "right")
textDisplayAddText(display, timer)

See also