- Documentation
- Server functions
- textCreateDisplay
Function
textCreateDisplay
Creates a text display: a set of texts drawn on the screens of chosen players, controlled entirely from the server (no client script). You add texts to it (textDisplayAddText) and observers - the players who see it (textDisplayAddObserver). Useful for simple messages, timers and scores.
Syntax
textdisplay textCreateDisplay()Returns
The new display.
Example
local display = textCreateDisplay()
local label = textCreateTextItem("Wyscig startuje za 10 s", 0.5, 0.3, "medium", 255, 200, 0, 255, 2, "center", "center")
textDisplayAddText(display, label)
for _, player in ipairs(getElementsByType("player")) do textDisplayAddObserver(display, player) end
See also
textCreateTextItemCreates 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.textDisplayAddTextAdds a text item to a display; all the display's observers will see it.textDisplayAddObserverShows a display to a player (adds them to the observers).