DgsGetFont

From Multi Theft Auto: Wiki
Revision as of 04:00, 31 August 2017 by Thisdp (talk | contribs) (Created page with "{{Client function}} __NOTOC__ This function is used to get the current font that is used to draw text in GUI elements. ==Syntax== <syntaxhighlight lang="lua"> string/element...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This function is used to get the current font that is used to draw text in GUI elements.

Syntax

string/element dgsDxGUIGetFont ( element dgsElement )

Required Arguments

  • dgsElement: The DGS element you wish to get the font of.

Returns

  • string A string containing the name of the element's current font, or false if the dgs element passed to the function is invalid.
  • element The custom dx font that is used, or nil otherwise

Example

This example sets and gets the font of a pre-made dgs 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

Custom Cursor Functions

Multi Language Supports

Animation

3D Element

3D Interface

3D Line

3D Image

3D Text

Browser

Button

Check Box

Combo Box

Custom Renderer

Edit

Detect Area

Drag'N Drop

Grid List

Image

Memo

Menu

Label

Layout

Line

Progress Bar

Radio Button

Scale Pane

Scroll Bar

Scroll Pane

Selector

Style

Switch Button

Tab Panel

Window

Basic Shape Plugins

Circle

Quadrilateral

Rounded Rectangle

Other Plugins

Blur Box

Canvas

Chart

Color Picker

Effect 3D

Gradient

Mask

Media Browser

Nine Slice

Object Preview Supports

Paste Handler

QRCode

Remote Image

Screen Source

SVG

Tooltips