TextCreateDisplay: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 9: Line 9:


==Example==
==Example==
textDisplay = [[textCreateDisplay]] () [[--created display]]
<syntaxhighlight lang="lua">
[[textDisplayAddObserver]] ( textDisplay, player ) [[--made display visible to player]]
textDisplay = [[textCreateDisplay]] () --created display
textItem = [[textCreateTextItem]] ( "Hello world!", 0.5, 0.5 ) [[--created item for the display]]
[[textDisplayAddObserver]] ( textDisplay, player ) --made display visible to player
[[textDisplayAddText]] ( textDisplay, textItem ) [[--added created item for display to display]]
textItem = [[textCreateTextItem]] ( "Hello world!", 0.5, 0.5 ) --created item for the display
[[textDisplayAddText]] ( textDisplay, textItem ) --added created item for display to display
</syntaxhighlight>

Revision as of 19:30, 17 May 2006

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

textDisplay = [[textCreateDisplay]] () --created display
[[textDisplayAddObserver]] ( textDisplay, player ) --made display visible to player
textItem = [[textCreateTextItem]] ( "Hello world!", 0.5, 0.5 ) --created item for the display
[[textDisplayAddText]] ( textDisplay, textItem ) --added created item for display to display