guiLabelSetColor | Multi Theft Auto: Wiki Skip to content

guiLabelSetColor

Client-side
Server-side
Shared

Pair: guiLabelGetColor

Manual Review Required

Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.


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

OOP Syntax Help! I don't understand this!

Syntax

bool guiLabelSetColor ( element theElement, int red, int green, int blue )
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

  • bool: value

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

Code Examples

shared

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

GUI Functions