DgsGetFont

From Multi Theft Auto: Wiki

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

Syntax

string/element dgsGetFont ( 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 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.

DGS = exports.dgs
-- We create a dummy dgs label to get text of
local dummyGUIElement = DGS:dgsCreateLabel ( 0.45, 0.48, 0.10, 0.04, "Hello world", true )
DGS:dgsSetFont ( dummyGUIElement, "clear" )
-- Output the font of the label to chat box
outputChatBox ( "Font used in the GUI label: " .. DGS:dgsGetFont( dummyGuiElement ) )

See Also

Multi Language Supports

Animation

3D Interface

3D Text

Arrow List

Browser

Button

Check Box

Combo Box

Edit

Ellipse Detect Area

Detect Area

Grid List

Image

Memo

Label

Progress Bar

Radio Button

Scroll Bar

Scroll Pane

Switch Button

Tab Panel

Window

Plugin

Media Browser

Rounded Rectangle

Color Picker

Blur Box

Effect 3D