TextCreateDisplay: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Server function}} | |||
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. For example, you could have a display that showed a score, and a display that showed information specific to one team, such as the location of the flag. Every player would be an observer of the first display and each team would have their own display that its players would be observers of. | 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. For example, you could have a display that showed a score, and a display that showed information specific to one team, such as the location of the flag. Every player would be an observer of the first display and each team would have their own display that its players would be observers of. | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua">textdisplay textCreateDisplay ()</syntaxhighlight> | ||
</syntaxhighlight> | |||
==Required Arguments== | ==Required Arguments== | ||
Line 12: | Line 11: | ||
==Example== | ==Example== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
myTextDisplay = textCreateDisplay () -- | myTextDisplay = textCreateDisplay () -- create a text display | ||
textDisplayAddObserver ( myTextDisplay, myPlayer ) -- | textDisplayAddObserver ( myTextDisplay, myPlayer ) -- make it visible to a player | ||
myTextItem = textCreateTextItem ( "Hello world!", 0.5, 0.5 ) -- | myTextItem = textCreateTextItem ( "Hello world!", 0.5, 0.5 ) -- create a text item for the display | ||
textDisplayAddText ( myTextDisplay, myTextItem ) --added | textDisplayAddText ( myTextDisplay, myTextItem ) -- added it to the display so it is displayed | ||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | ==See Also== | ||
{{Text functions}} | {{Text functions}} |
Revision as of 18:10, 15 August 2007
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. For example, you could have a display that showed a score, and a display that showed information specific to one team, such as the location of the flag. Every player would be an observer of the first display and each team would have their own display that its players would be observers of.
Syntax
textdisplay textCreateDisplay ()
Required Arguments
This function has no arguments.
Example
myTextDisplay = textCreateDisplay () -- create a text display textDisplayAddObserver ( myTextDisplay, myPlayer ) -- make it visible to a player myTextItem = textCreateTextItem ( "Hello world!", 0.5, 0.5 ) -- create a text item for the display textDisplayAddText ( myTextDisplay, myTextItem ) -- added it to the display so it is displayed
See Also
- textCreateDisplay
- textCreateTextItem
- textDestroyDisplay
- textDestroyTextItem
- textDisplayAddObserver
- textDisplayAddText
- textDisplayGetObservers
- textDisplayIsObserver
- textDisplayRemoveObserver
- textDisplayRemoveText
- textItemGetColor
- textItemGetPosition
- textItemGetPriority
- textItemGetScale
- textItemGetText
- textItemSetColor
- textItemSetPosition
- textItemSetPriority
- textItemSetScale
- textItemSetText