GuiLabelGetColor: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
mNo edit summary
Line 16: Line 16:
Returns three ''int'' values, representing the amount of red, green, blue if successful. ''false'' otherwise.
Returns three ''int'' values, representing the amount of red, green, blue if successful. ''false'' otherwise.


==Example==  
==Example==
TODO
This example creates a label in the center of the screen and sets the color, then outputs the color.
<section name="Client" class="client" show="true">
<syntaxhighlight lang="lua">local label = guiCreateLabel(0,0,10,10,"LABEL COLOR!!!",false)
<syntaxhighlight lang="lua">
guiLabelSetColor ( label, math.random(0, 255), math.random(0, 255), math.random(0, 255) )
--TODO
local r,g,b = guiLabelGetColor ( label )
outputChatBox("The label color is R:"..r.." G:"..g.." B:"..b.." .")
setTImer(destroyElement,10000,1,label)
</syntaxhighlight>
</syntaxhighlight>
</section>


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

Revision as of 20:45, 20 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

This example creates a label in the center of the screen and sets the color, then outputs the color.

local label = guiCreateLabel(0,0,10,10,"LABEL COLOR!!!",false)
guiLabelSetColor ( label, math.random(0, 255), math.random(0, 255), math.random(0, 255) )
local r,g,b = guiLabelGetColor ( label )
outputChatBox("The label color is R:"..r.." G:"..g.." B:"..b.." .")
setTImer(destroyElement,10000,1,label)

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