DgsLabelSetColor

From Multi Theft Auto: Wiki
Revision as of 15:19, 12 June 2017 by Thisdp (talk | contribs) (Created page with "{{Client function}} __NOTOC__ <!-- Describe in plain english what this function does. Don't go into details, just give an overview --> This function allows you to set the colo...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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

Syntax

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

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).
  • alpha: An integer specifying the amount of alpha (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 )
DGS = exports.dgs
DGS:dgsDxLabelSetColor ( myLabel, math.random(0, 255), math.random(0, 255), math.random(0, 255) )

See Also

Custom Cursor Functions

Multi Language Supports

Animation

3D Element

3D Interface

3D Line

3D Image

3D Text

Browser

Button

Check Box

Combo Box

Custom Renderer

Edit

Detect Area

Drag'N Drop

Grid List

Image

Memo

Menu

Label

Layout

Line

Progress Bar

Radio Button

Scale Pane

Scroll Bar

Scroll Pane

Selector

Style

Switch Button

Tab Panel

Window

Basic Shape Plugins

Circle

Quadrilateral

Rounded Rectangle

Other Plugins

Blur Box

Canvas

Chart

Color Picker

Effect 3D

Gradient

Mask

Media Browser

Nine Slice

Object Preview Supports

Paste Handler

QRCode

Remote Image

Screen Source

SVG

Tooltips