DgsSetFont: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Created page with "{{Client function}} __NOTOC__ This function sets the font of a dgs element to be used when drawing text. ==Syntax== <syntaxhighlight lang="lua"> bool dgsDxGUISetFont( elemen...")
 
m (Thisdp moved page DgsDxGUISetFont to DgsSetFont)
(No difference)

Revision as of 15:32, 16 January 2018

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

Syntax

bool dgsDxGUISetFont( 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:dgsDxCreateLabel ( 0.45, 0.48, 0.10, 0.04, "Hello world", true )
DGS:dgsDxGUISetFont ( dummyGUIElement, "clear" )
-- Output the font of the label to chat box
outputChatBox ( "Font used in the DGS label: " .. DGS:dgsDxGUIGetFont ( 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