GuiSetFont: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
(9 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
{{Client function}} | {{Client function}} | ||
__NOTOC__ | __NOTOC__ | ||
This function sets the font of a GUI element to be used when drawing text. | This function sets the font of a [[GUI_widgets|GUI element]] to be used when drawing text. | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
bool guiSetFont ( element guiElement, | bool guiSetFont ( element guiElement, mixed font ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{OOP||[[GUI widgets|GuiElement]]:setFont|font|guiGetFont}} | |||
===Required Arguments=== | ===Required Arguments=== | ||
*'''guiElement:''' The GUI element you wish to change the font of | *'''guiElement:''' The GUI element you wish to change the font of | ||
*'''font:''' | *'''font:''' Either a custom [[GUI font]] element or the name of a built-in GUI font. See [[Standard GUI Font Names]] | ||
===Returns=== | ===Returns=== | ||
Returns ''true'' if the font has been successfully set on the gui element, ''false'' otherwise. | Returns ''true'' if the font has been successfully set on the gui element, ''false'' otherwise. | ||
==Example== | ==Example== | ||
<!-- Explain what the example is in a single | <!-- Explain what the example is in a single sentence --> | ||
This example sets and gets the font of a pre-made gui element and outputs it to chat box. | This example sets and gets the font of a pre-made gui element and outputs it to chat box. | ||
<!-- Add the code below, an emphasis should be on making it clear, not optimized. You could provide two versions if you wish, one clear and well commented, the other optimized --> | <!-- Add the code below, an emphasis should be on making it clear, not optimized. You could provide two versions if you wish, one clear and well commented, the other optimized --> | ||
Line 29: | Line 29: | ||
==See Also== | ==See Also== | ||
{{GUI_functions}} | {{GUI_functions}} | ||
] | {{GUI_events}} | ||
[[hu:guiSetFont]] | |||
[[pl:guiSetFont]] |
Latest revision as of 19:09, 9 December 2018
This function sets the font of a GUI element to be used when drawing text.
Syntax
bool guiSetFont ( element guiElement, mixed font )
OOP Syntax Help! I don't understand this!
- Method: GuiElement:setFont(...)
- Variable: .font
- Counterpart: guiGetFont
Required Arguments
- guiElement: The GUI element you wish to change the font of
- font: Either a custom GUI font element or the name of a built-in GUI font. See Standard GUI Font Names
Returns
Returns true if the font has been successfully set on the gui element, false otherwise.
Example
This example sets and gets the font of a pre-made gui element and outputs it to chat box.
-- We create a dummy gui label to get text of local dummyGUIElement = guiCreateLabel ( 0.45, 0.48, 0.10, 0.04, "Hello world", true ) guiSetFont ( dummyGUIElement, "sa-gothic" ) -- Output the font of the label to chat box outputChatBox ( "Font used in the GUI label: " .. guiGetFont ( dummyGuiElement ) )
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