GuiLabelSetColor: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
m (Added OOP Method + Counterpart Information)
 
Line 9: Line 9:
bool guiLabelSetColor ( element theElement, int red, int green, int blue )
bool guiLabelSetColor ( element theElement, int red, int green, int blue )
</syntaxhighlight>  
</syntaxhighlight>  
{{OOP||[[Element/GUI/Text label|GuiLabel]]:setColor||guiLabelGetColor}}


===Required Arguments===  
===Required Arguments===  

Latest revision as of 11:41, 7 August 2019

This function allows you to set the color of a GUI label.

Syntax

bool guiLabelSetColor ( element theElement, int red, int green, int blue )

OOP Syntax Help! I don't understand this!

Method: GuiLabel:setColor(...)
Counterpart: guiLabelGetColor


Required Arguments

  • theElement: The label to be changed.
  • red: An integer specifying the amount of red (0 to 255).
  • green: An integer specifying the amount of green (0 to 255).
  • blue: An integer specifying the amount of blue (0 to 255).

Returns

Returns true if the the color of the gui label was successfully changed, false otherwise.

Example

This example creates a label with text "Hello World!" and sets it to a random color.

local myLabel = guiCreateLabel ( 0.45, 0.48, 0.2, 0.5, "Hello world", true )
guiLabelSetColor ( myLabel, math.random(0, 255), math.random(0, 255), math.random(0, 255) )

See Also

General functions

Browsers

Buttons

Checkboxes

Comboboxes

Edit Boxes

Gridlists

Memos

Progressbars

Radio Buttons

Scrollbars

Scrollpanes

Static Images

Tab Panels

Tabs

Text Labels

Windows

Input

GUI