TextDisplayRemoveObserver: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
mNo edit summary |
||
(4 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Server function}} | {{Server function}} | ||
This function removes a [[player]] observer of a [[textdisplay]]. This stops the [[player]] from being able to see [[textitem]]s that the [[textdisplay]] contains. | This function removes a [[player]] observer of a [[textdisplay]]. This stops the [[player]] from being able to see [[textitem]]s that the [[textdisplay]] contains. | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua">bool textDisplayRemoveObserver ( textdisplay display, player playerToRemove )</syntaxhighlight> | ||
===Required Arguments=== | ===Required Arguments=== | ||
Line 13: | Line 12: | ||
==Example== | ==Example== | ||
<syntaxhighlight lang="lua">display = textCreateDisplay ( ) | This example creates a new display and a "Hello World" text item for a player. It then removes it from his screen 5 seconds later | ||
textDisplayAddObserver ( display, thePlayer ) | <syntaxhighlight lang="lua">display = textCreateDisplay ( ) --create the display | ||
textDisplayAddObserver ( display, thePlayer ) --add an observer | |||
newtextitem = textCreateTextItem ( "Hello World", 0.5, 0.5, "low", 255, 0, 0, 0, 1.0 ) | newtextitem = textCreateTextItem ( "Hello World", 0.5, 0.5, "low", 255, 0, 0, 0, 1.0 ) --create our "Hello World" text item | ||
textDisplayAddText ( display, newtextitem ) | textDisplayAddText ( display, newtextitem ) --add this to the display | ||
setTimer ( textDisplayRemoveObserver, 5000,1, display, thePlayer ) --set a timer to remove this 5 seconds later. | |||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | ==See Also== | ||
{{Text functions}} | {{Text functions}} |
Latest revision as of 14:01, 21 September 2011
This function removes a player observer of a textdisplay. This stops the player from being able to see textitems that the textdisplay contains.
Syntax
bool textDisplayRemoveObserver ( textdisplay display, player playerToRemove )
Required Arguments
- display: The textdisplay to remove the player from as an observer.
- playerToRemove: The player that should be removed from the textdisplay.
Example
This example creates a new display and a "Hello World" text item for a player. It then removes it from his screen 5 seconds later
display = textCreateDisplay ( ) --create the display textDisplayAddObserver ( display, thePlayer ) --add an observer newtextitem = textCreateTextItem ( "Hello World", 0.5, 0.5, "low", 255, 0, 0, 0, 1.0 ) --create our "Hello World" text item textDisplayAddText ( display, newtextitem ) --add this to the display setTimer ( textDisplayRemoveObserver, 5000,1, display, thePlayer ) --set a timer to remove this 5 seconds later.
See Also
- textCreateDisplay
- textCreateTextItem
- textDestroyDisplay
- textDestroyTextItem
- textDisplayAddObserver
- textDisplayAddText
- textDisplayGetObservers
- textDisplayIsObserver
- textDisplayRemoveObserver
- textDisplayRemoveText
- textItemGetColor
- textItemGetPosition
- textItemGetPriority
- textItemGetScale
- textItemGetText
- textItemSetColor
- textItemSetPosition
- textItemSetPriority
- textItemSetScale
- textItemSetText