TextCreateDisplay: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
|||
Line 11: | Line 11: | ||
==Example== | ==Example== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function MyTestTextFunction () | |||
myTextDisplay = textCreateDisplay () -- create a text display | myTextDisplay = textCreateDisplay () -- create a text display | ||
textDisplayAddObserver ( myTextDisplay, myPlayer ) -- make it visible to a player | textDisplayAddObserver ( myTextDisplay, myPlayer ) -- make it visible to a player | ||
myTextItem = textCreateTextItem ( "Hello world!", 0.5, 0.5 ) -- create a text item for the display | myTextItem = textCreateTextItem ( "Hello world!", 0.5, 0.5 ) -- create a text item for the display | ||
textDisplayAddText ( myTextDisplay, myTextItem ) -- add it to the display so it is displayed | textDisplayAddText ( myTextDisplay, myTextItem ) -- add it to the display so it is displayed | ||
end | |||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | ==See Also== | ||
{{Text functions}} | {{Text functions}} |
Revision as of 18:29, 7 October 2008
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 MyTestTextFunction () 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 ) -- add it to the display so it is displayed end
See Also
- textCreateDisplay
- textCreateTextItem
- textDestroyDisplay
- textDestroyTextItem
- textDisplayAddObserver
- textDisplayAddText
- textDisplayGetObservers
- textDisplayIsObserver
- textDisplayRemoveObserver
- textDisplayRemoveText
- textItemGetColor
- textItemGetPosition
- textItemGetPriority
- textItemGetScale
- textItemGetText
- textItemSetColor
- textItemSetPosition
- textItemSetPriority
- textItemSetScale
- textItemSetText