TextItemGetColor: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
This | This function allows you to retrieve the color of a text item. | ||
==Syntax== | ==Syntax== | ||
Line 10: | Line 8: | ||
===Required Arguments=== | ===Required Arguments=== | ||
*''' | *'''textitem:''' The text item you wish to retrieve the colour of. | ||
===Returns=== | ===Returns=== | ||
Returns '' | Returns four integers in RGBA format, with a maximum value of 255 for each. Each stands for ''red'', ''green'', ''blue'', and ''alpha''. Alpha decides transparancy where 255 is opaque and 0 is transparent. ''false'' is returned if the blip is invalid. | ||
==Example== | ==Example== | ||
This example | This example gets the color of a textitem named 'textitem' and if it is green, changes it to blue. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
r,g,b,a = textItemGetColor ( textitem ) | |||
if ( r == 0 ) and ( g == 255 ) and ( b == 0 ) then | |||
textItemSetColor ( textitem, 0, 0, 255, 0 ) | |||
end | |||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | ==See Also== | ||
{{ | {{Text functions}} |
Revision as of 15:18, 16 August 2006
This function allows you to retrieve the color of a text item.
Syntax
int int int int textItemGetColor ( textitem textitem )
Required Arguments
- textitem: The text item you wish to retrieve the colour of.
Returns
Returns four integers in RGBA format, with a maximum value of 255 for each. Each stands for red, green, blue, and alpha. Alpha decides transparancy where 255 is opaque and 0 is transparent. false is returned if the blip is invalid.
Example
This example gets the color of a textitem named 'textitem' and if it is green, changes it to blue.
r,g,b,a = textItemGetColor ( textitem ) if ( r == 0 ) and ( g == 255 ) and ( b == 0 ) then textItemSetColor ( textitem, 0, 0, 255, 0 ) end
See Also
- textCreateDisplay
- textCreateTextItem
- textDestroyDisplay
- textDestroyTextItem
- textDisplayAddObserver
- textDisplayAddText
- textDisplayGetObservers
- textDisplayIsObserver
- textDisplayRemoveObserver
- textDisplayRemoveText
- textItemGetColor
- textItemGetPosition
- textItemGetPriority
- textItemGetScale
- textItemGetText
- textItemSetColor
- textItemSetPosition
- textItemSetPriority
- textItemSetScale
- textItemSetText