textItemSetColor
Client-side
Server-side
Shared
Manual Review Required
Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.
This function sets the color of a text item.
Syntax
bool textItemSetColor ( textitem theTextItem, int r, int g, int b, int a )Required Arguments
- theTextItem: The textitem you wish to set the color of.
- r: MISSING_PARAM_DESC
- g: MISSING_PARAM_DESC
- b: MISSING_PARAM_DESC
- a: MISSING_PARAM_DESC
Returns
- bool: value
Returns true if the color was successfully set, false otherwise.
Code Examples
shared
This example gets the color of a textitem named 'theTextItem' and if it is green, changes it to blue.
r,g,b,a = textItemGetColor ( theTextItem ) -- get the text color and store it in the variables 'r', 'g', 'b' and 'a'if ( r == 0 ) and ( g == 255 ) and ( b == 0 ) then -- if the color is green textItemSetColor ( theTextItem, 0, 0, 255, 255 ) -- set it to blueendSee Also
Text Functions
- textCreateDisplay
- textCreateTextItem
- textDestroyDisplay
- textDestroyTextItem
- textDisplayAddObserver
- textDisplayAddText
- textDisplayGetObservers
- textDisplayIsObserver
- textDisplayRemoveObserver
- textDisplayRemoveText
- textItemGetColor
- textItemGetPosition
- textItemGetPriority
- textItemGetScale
- textItemGetText
- textItemSetColor
- textItemSetPosition
- textItemSetPriority
- textItemSetScale
- textItemSetText