DgsSetFont

From Multi Theft Auto: Wiki

This function sets the font of a dgs element to be used when drawing text.

Syntax

bool dgsSetFont( element dgsElement, mixed font )

Required Arguments

  • dgsElement: The DGS element you wish to change the font of
  • font: Either a custom dx font element or the name of a built-in dx font (Can be affected by setSystemFont).

Returns

Returns true if the font has been successfully set on the dgs element, false otherwise.

Example

This example sets and gets the font of a pre-made gui element and outputs it to chat box.

DGS = exports.dgs
-- We create a dummy gui 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 DGS 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