GuiLabelGetColor: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
Line 17: Line 17:


==Example==  
==Example==  
This example creates a label, set random color and when player type command '''/get_color_label''' it's return label color.
TODO
<section name="Client" class="client" show="true">
<section name="Client" class="client" show="true">
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
local pLabel = guiCreateLabel( 0.5, 0.5, 0.5, 0.5, 'Text', true )
--TODO
guiLabelSetColor( pLabel, math.random( 0, 255 ), math.random( 0, 255 ), math.random( 0, 255 ) )
</syntaxhighlight>
 
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
)</syntaxhighlight>
</section>
</section>


==See Also==
==See Also==
{{GUI functions}}
{{GUI functions}}
[[Category:Needs Example]]

Revision as of 13:20, 17 September 2012

ADDED/UPDATED IN VERSION 1.3.1 r4670:

This function gets the color of a label.

Syntax

int int int guiLabelGetColor ( gui-element theLabel )

Required Arguments

  • theLabel: The label to get color.

Returns

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

Example

TODO

Click to collapse [-]
Client
--TODO

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