GuiSetFont: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(OOP syntax)
Line 30: Line 30:
{{GUI_functions}}
{{GUI_functions}}
[[pl:guiSetFont]]
[[pl:guiSetFont]]
{{GUI_events}}

Revision as of 17:19, 21 November 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

Browsers

Buttons

Checkboxes

Comboboxes

Edit Boxes

Gridlists

Memos

Progressbars

Radio Buttons

Scrollbars

Scrollpanes

Static Images

Tab Panels

Tabs

Text Labels

Windows

Input

GUI