DgsLabelGetFontHeight

From Multi Theft Auto: Wiki

This function returns the height of the font currently used in a DGS text label.

Syntax

float dgsLabelGetFontHeight ( element theLabel )

Required Arguments

  • theLabel: The text label to get the font height from.

Returns

Returns the absolute height of the font currently used in the text label if the function is successful, false otherwise.

Example

This example creates a window, a text label, gets the text extent and font height, and sets the text label size according to these values.

DGS = exports.dgs
-- create the window (the container for our label)
local myWindow = DGS:dgsCreateWindow ( 0, 0, 0.5, 0.4, "Information", true )

-- create the label
local myLabel = DGS:dgsCreateLabel ( 10, 10, 0, 0, "This is my text container", false, myWindow )

-- get the (absolute) text extent and font height, and use these to size the label
DGS:dgsSetSize ( myLabel, DGS:dgsLabelGetTextExtent ( myLabel ), DGS:dgsLabelGetFontHeight ( myLabel ), false )

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