TextItemSetColor: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
 
No edit summary
Line 1: Line 1:
[[Category:Incomplete]]
__NOTOC__  
__NOTOC__  
This fake function is for use with blah & blah and does blahblahblabhalbhl
This function allows the setting of the color of a text item


==Syntax==  
==Syntax==  
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
void textItemSetColor ( textitem textitem, int r, int g, int b, int a )               
bool textItemSetColor ( textitem textitem, int r, int g, int b, int a )               
</syntaxhighlight>  
</syntaxhighlight>  


===Required Arguments===  
===Required Arguments===  
*'''argumentName:''' description
*'''textitem:''' The textitem you wish to set the color of.
*'''red:''' The amount of red in the blip's color (0 - 255).
*'''green:''' The amount of green in the blip's color (0 - 255).
*'''blue:''' The amount of blue in the blip's color (0 - 255).
*'''alpha:''' The amount of alpha in the blip's color (0 - 255).  Alpha decides transparancy where 255 is opaque and 0 is transparent.


===Optional Arguments===
{{OptionalArg}}
*'''argumentName2:''' descriptiona
*'''argumentName3:''' description


===Returns===
===Returns===
Returns ''true'' if blah, ''false'' otherwise.
Returns ''true'' if the color was successfully set, ''false'' otherwise.


==Example==  
==Example==  
This example does...
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">
--This line does...
r,g,b,a = textItemGetColor ( textitem )
blabhalbalhb --abababa
if ( r == 0 ) and ( g == 255 ) and ( b == 0 ) then
--This line does this...
    textItemSetColor ( textitem, 0, 0, 255, 0 )
mooo
end
</syntaxhighlight>
</syntaxhighlight>


==See Also==
==See Also==
{{FunctionArea_Functions}}
{{Text functions}}

Revision as of 15:24, 16 August 2006

This function allows the setting of the color of a text item

Syntax

bool textItemSetColor ( textitem textitem, int r, int g, int b, int a )              

Required Arguments

  • textitem: The textitem you wish to set the color of.
  • red: The amount of red in the blip's color (0 - 255).
  • green: The amount of green in the blip's color (0 - 255).
  • blue: The amount of blue in the blip's color (0 - 255).
  • alpha: The amount of alpha in the blip's color (0 - 255). Alpha decides transparancy where 255 is opaque and 0 is transparent.


Returns

Returns true if the color was successfully set, false otherwise.

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