TextDisplayAddText: Difference between revisions
Jump to navigation
Jump to search
m (→Syntax) |
No edit summary |
||
Line 4: | Line 4: | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | |||
void textDisplayAddText ( textitem itemToAdd, textdisplay displayToAddTo ) | |||
</syntaxhighlight> | |||
===Required Arguments=== | ===Required Arguments=== | ||
* '''itemToAdd''': The [[textitem]] to add to the display. | * '''itemToAdd''': The [[textitem]] to add to the display. | ||
* '''displayToAddTo''': The [[textdisplay]] to add the [[textitem]] to. | * '''displayToAddTo''': The [[textdisplay]] to add the [[textitem]] to. | ||
==Example== | ==Example== | ||
<syntaxhighlight lang="lua"> | |||
-- Create a text display. | |||
myTextDisplay = textCreateDisplay (); | |||
-- Add a player as an observer, i.e. this player will see everything added to this display | |||
textDisplayAddObserver ( myTextDisplay, aPlayer ); | |||
-- Create a new text item with the text 'Hello World' and a priority of 'low' and colored red. | |||
myTextItem = textCreateTextItem ( "Hello World", 0.5, 0.5, "low", 255, 0, 0, 0, 1.0 ); | |||
-- Add the newly created text item to the display | |||
textDisplayAddText ( myTextDisplay, myTextItem ); | |||
</syntaxhighlight> |
Revision as of 03:44, 19 May 2006
Description
This function adds a textitem to a textdisplay. This allows any observers of the textdisplay to see the textitem.
Syntax
void textDisplayAddText ( textitem itemToAdd, textdisplay displayToAddTo )
Required Arguments
- itemToAdd: The textitem to add to the display.
- displayToAddTo: The textdisplay to add the textitem to.
Example
-- Create a text display. myTextDisplay = textCreateDisplay (); -- Add a player as an observer, i.e. this player will see everything added to this display textDisplayAddObserver ( myTextDisplay, aPlayer ); -- Create a new text item with the text 'Hello World' and a priority of 'low' and colored red. myTextItem = textCreateTextItem ( "Hello World", 0.5, 0.5, "low", 255, 0, 0, 0, 1.0 ); -- Add the newly created text item to the display textDisplayAddText ( myTextDisplay, myTextItem );