TextCreateDisplay: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
(12 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
A text display is like a canvas that can contain many items of text. Each display can be seen by multiple observers (players) and each player can see multiple displays | {{Server function}} | ||
A [[textdisplay|text display]] is like a canvas that can contain many [[textitem|items of text]]. Each display can be seen by multiple observers (players) and each player can see multiple displays. | |||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua">textdisplay textCreateDisplay()</syntaxhighlight> | |||
==Required Arguments== | ==Required Arguments== | ||
Line 9: | Line 10: | ||
==Example== | ==Example== | ||
<syntaxhighlight lang="lua"> | |||
function showTextDisplay ( player, command ) | |||
local serverDisplay = textCreateDisplay() -- create a text display | |||
textDisplayAddObserver ( serverDisplay, player ) -- make it visible to a player | |||
local serverText = textCreateTextItem ( "Hello world!", 0.5, 0.5 ) -- create a text item for the display | |||
textDisplayAddText ( serverDisplay, serverText ) -- add it to the display so it is displayed | |||
end | |||
addCommandHandler( "showText", showTextDisplay ) | |||
</syntaxhighlight> | |||
==See Also== | |||
{{Text functions}} | |||
Latest revision as of 00:39, 21 January 2011
A text display is like a canvas that can contain many items of text. Each display can be seen by multiple observers (players) and each player can see multiple displays.
Syntax
textdisplay textCreateDisplay()
Required Arguments
This function has no arguments.
Example
function showTextDisplay ( player, command ) local serverDisplay = textCreateDisplay() -- create a text display textDisplayAddObserver ( serverDisplay, player ) -- make it visible to a player local serverText = textCreateTextItem ( "Hello world!", 0.5, 0.5 ) -- create a text item for the display textDisplayAddText ( serverDisplay, serverText ) -- add it to the display so it is displayed end addCommandHandler( "showText", showTextDisplay )
See Also
- textCreateDisplay
- textCreateTextItem
- textDestroyDisplay
- textDestroyTextItem
- textDisplayAddObserver
- textDisplayAddText
- textDisplayGetObservers
- textDisplayIsObserver
- textDisplayRemoveObserver
- textDisplayRemoveText
- textItemGetColor
- textItemGetPosition
- textItemGetPriority
- textItemGetScale
- textItemGetText
- textItemSetColor
- textItemSetPosition
- textItemSetPriority
- textItemSetScale
- textItemSetText