guiLabelSetColor | Multi Theft Auto: Wiki Skip to content

guiLabelSetColor

Client-side
Server-side
Shared

Pair: guiLabelGetColor

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

OOP Syntax Help! I don't understand this!

Syntax

bool guiLabelSetColor ( ​gui-label 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

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

  • bool: result

Code Examples

client

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