GuiLabelGetColor

From Multi Theft Auto: Wiki
Revision as of 09:18, 16 September 2012 by Kenix1 (talk | contribs) (Created page with "{{Client function}} __NOTOC__ This function gets the color of a label. ==Syntax== <syntaxhighlight lang="lua"> int int int guiLabelGetColor ( element theLabel ) </syntaxhighlight> ===Required Argument...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This function gets the color of a label.

Syntax

int int int guiLabelGetColor ( element theLabel )

Required Arguments

  • theLabel: The label to get color.

Returns

Returns four int values, representing the amount of red, green, blue if successful. false otherwise.

Example

Click to collapse [-]
Client
local pLabel = guiCreateLabel( 0.5, 0.5, 0.5, 0.5, 'Text', true )
guiSetLabelColor( pLabel, math.random( 0, 255 ), math.random( 0, 255 ), math.random( 0, 255 ) )

addCommandHandler( 'get_color_label', 
    function()
        local iR, iG, iB = guiLabelGetColor( pLabel )
        outputChatBox( ( 'Label color is r = %s, g = %s, b = %s' ):foramt( iR, iG, iB ) )
    end
)


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