GuiLabelGetColor: Difference between revisions
Jump to navigation
Jump to search
m (Added OOP Method + Counterpart Information) |
|||
(6 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Client function}} | {{Client function}} | ||
{{New feature/item| | {{New feature/item|3.0132|1.3.1|4670| | ||
This function gets the color of a label. | This function gets the color of a label. | ||
}} | }} | ||
Line 9: | Line 9: | ||
int int int guiLabelGetColor ( gui-element theLabel ) | int int int guiLabelGetColor ( gui-element theLabel ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{OOP||[[Element/GUI/Text label|GuiLabel]]:getColor||guiLabelSetColor}} | |||
===Required Arguments=== | ===Required Arguments=== | ||
*'''theLabel:''' The label to get color. | *'''theLabel:''' The label to get color. | ||
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== | ||
<syntaxhighlight lang="lua">local pLabel = guiCreateLabel( 0.5, 0.5, 0.5, 0.5, 'Text', true ) | |||
< | guiLabelSetColor( pLabel, math.random( 0, 255 ), math.random( 0, 255 ), math.random( 0, 255 ) ) | ||
addCommandHandler( 'get_color_label', | |||
</syntaxhighlight | function() | ||
local iR, iG, iB = guiLabelGetColor( pLabel ) | |||
outputChatBox( ( 'Label color is r = %d, g = %d, b = %d' ):format( iR, iG, iB ) ) | |||
end | |||
)</syntaxhighlight> | |||
==See Also== | ==See Also== | ||
{{GUI functions}} | {{GUI functions}} | ||
{{GUI_events}} |
Latest revision as of 11:40, 7 August 2019
This function gets the color of a label.
Syntax
int int int guiLabelGetColor ( gui-element theLabel )
OOP Syntax Help! I don't understand this!
- Method: GuiLabel:getColor(...)
- Counterpart: guiLabelSetColor
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
local pLabel = guiCreateLabel( 0.5, 0.5, 0.5, 0.5, 'Text', true ) guiLabelSetColor( 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 = %d, g = %d, b = %d' ):format( iR, iG, iB ) ) end )
See Also
General functions
- guiBringToFront
- getChatboxLayout
- getChatboxCharacterLimit
- guiCreateFont
- guiBlur
- guiFocus
- guiGetAlpha
- guiGetCursorType
- guiGetEnabled
- guiGetFont
- guiGetInputEnabled
- guiGetInputMode
- guiGetPosition
- guiGetProperties
- guiGetProperty
- guiGetScreenSize
- guiGetSize
- guiGetText
- guiGetVisible
- guiMoveToBack
- guiSetAlpha
- guiSetEnabled
- guiSetFont
- guiSetInputEnabled
- guiSetInputMode
- guiSetPosition
- guiSetProperty
- guiSetSize
- guiSetText
- guiSetVisible
- isChatBoxInputActive
- isConsoleActive
- isDebugViewActive
- isMainMenuActive
- isMTAWindowActive
- isTransferBoxActive
- setChatboxCharacterLimit
- setDebugViewActive
Browsers
Buttons
Checkboxes
Comboboxes
- guiCreateComboBox
- guiComboBoxAddItem
- guiComboBoxClear
- guiComboBoxGetItemCount
- guiComboBoxGetItemText
- guiComboBoxGetSelected
- guiComboBoxIsOpen
- guiComboBoxRemoveItem
- guiComboBoxSetItemText
- guiComboBoxSetOpen
- guiComboBoxSetSelected
Edit Boxes
- guiCreateEdit
- guiEditGetCaretIndex
- guiEditGetMaxLength
- guiEditIsMasked
- guiEditIsReadOnly
- guiEditSetCaretIndex
- guiEditSetMasked
- guiEditSetMaxLength
- guiEditSetReadOnly
Gridlists
- guiCreateGridList
- guiGridListAddColumn
- guiGridListAddRow
- guiGridListAutoSizeColumn
- guiGridListClear
- guiGridListGetColumnCount
- guiGridListGetColumnTitle
- guiGridListGetColumnWidth
- guiGridListGetHorizontalScrollPosition
- guiGridListGetItemColor
- guiGridListGetItemData
- guiGridListGetItemText
- guiGridListGetRowCount
- guiGridListGetSelectedCount
- guiGridListGetSelectedItem
- guiGridListGetSelectedItems
- guiGridListGetSelectionMode
- guiGridListIsSortingEnabled
- guiGridListGetVerticalScrollPosition
- guiGridListInsertRowAfter
- guiGridListRemoveColumn
- guiGridListRemoveRow
- guiGridListSetColumnTitle
- guiGridListSetColumnWidth
- guiGridListSetHorizontalScrollPosition
- guiGridListSetItemColor
- guiGridListSetItemData
- guiGridListSetItemText
- guiGridListSetScrollBars
- guiGridListSetSelectedItem
- guiGridListSetSelectionMode
- guiGridListSetSortingEnabled
- guiGridListSetVerticalScrollPosition
Memos
- guiCreateMemo
- guiMemoGetCaretIndex
- guiMemoGetVerticalScrollPosition
- guiMemoSetVerticalScrollPosition
- guiMemoIsReadOnly
- guiMemoSetCaretIndex
- guiMemoSetReadOnly
Progressbars
Radio Buttons
Scrollbars
Scrollpanes
- guiCreateScrollPane
- guiScrollPaneGetHorizontalScrollPosition
- guiScrollPaneGetVerticalScrollPosition
- guiScrollPaneSetHorizontalScrollPosition
- guiScrollPaneSetScrollBars
- guiScrollPaneSetVerticalScrollPosition
Static Images
Tab Panels
Tabs
Text Labels
- guiCreateLabel
- guiLabelGetColor
- guiLabelGetFontHeight
- guiLabelGetTextExtent
- guiLabelSetColor
- guiLabelSetHorizontalAlign
- guiLabelSetVerticalAlign
Windows
Input
GUI
- onClientGUIAccepted
- onClientGUIBlur
- onClientGUIChanged
- onClientGUIClick
- onClientGUIComboBoxAccepted
- onClientGUIDoubleClick
- onClientGUIFocus
- onClientGUIMouseDown
- onClientGUIMouseUp
- onClientGUIMove
- onClientGUIScroll
- onClientGUISize
- onClientGUITabSwitched
- onClientMouseEnter
- onClientMouseLeave
- onClientMouseMove
- onClientMouseWheel