\FML\ControlsLabel

Label Control (CMlLabel)

Summary

Methods
Properties
Constants
create()
__construct()
getId()
setId()
checkId()
getX()
setX()
getY()
setY()
getZ()
setZ()
setPosition()
getWidth()
setWidth()
getHeight()
setHeight()
setSize()
getHorizontalAlign()
setHAlign()
setHorizontalAlign()
getVerticalAlign()
setVAlign()
setVerticalAlign()
setAlign()
centerAlign()
resetAlign()
clearAlign()
getScale()
setScale()
getVisible()
setVisible()
getRotation()
setRotation()
getClasses()
addClass()
addClasses()
removeAllClasses()
hasDataAttribute()
getDataAttribute()
getDataAttributes()
addDataAttribute()
addDataAttributes()
setDataAttributes()
removeDataAttribute()
removeAllDataAttributes()
getScriptFeatures()
addScriptFeature()
addScriptFeatures()
removeScriptFeatures()
removeAllScriptFeatures()
addActionTriggerFeature()
addMapInfoFeature()
addPlayerProfileFeature()
addUISoundFeature()
addToggleFeature()
addTooltipFeature()
addTooltipLabelFeature()
addScriptText()
render()
__toString()
getTagName()
getManiaScriptClass()
getText()
setText()
getTextId()
setTextId()
getTextPrefix()
setTextPrefix()
getTextEmboss()
setTextEmboss()
getTranslate()
setTranslate()
getOpacity()
setOpacity()
getAction()
setAction()
getActionKey()
setActionKey()
getUrl()
setUrl()
getUrlId()
setUrlId()
getManialink()
setManialink()
getManialinkId()
setManialinkId()
getAutoNewLine()
setAutoNewLine()
getLineSpacing()
setLineSpacing()
getMaxLines()
setMaxLines()
getScriptEvents()
setScriptEvents()
getScriptAction()
setScriptAction()
getScriptActionParameters()
setScriptActionParameters()
getStyle()
setStyle()
getTextSize()
setTextSize()
getTextFont()
setTextFont()
getTextColor()
setTextColor()
getAreaColor()
setAreaColor()
getAreaFocusColor()
setAreaFocusColor()
addClockFeature()
No public properties found
CENTER
CENTER2
TOP
RIGHT
BOTTOM
LEFT
No protected methods found
$controlId
$posX
$posY
$posZ
$width
$height
$horizontalAlign
$verticalAlign
$scale
$visible
$rotation
$classes
$dataAttributes
$scriptFeatures
$text
$textId
$textPrefix
$textEmboss
$translate
$maxLines
$opacity
$action
$actionKey
$url
$urlId
$manialink
$manialinkId
$autoNewLine
$lineSpacing
$scriptEvents
$scriptAction
$scriptActionParameters
$style
$textSize
$textFont
$textColor
$areaColor
$focusAreaColor
N/A
No private methods found
No private properties found
N/A

Constants

CENTER

CENTER

CENTER2

CENTER2

TOP

TOP

RIGHT

RIGHT

BOTTOM

BOTTOM

LEFT

LEFT

Properties

$controlId

$controlId : string

Type

string — Control Id

$posX

$posX : float

Type

float — X position

$posY

$posY : float

Type

float — Y position

$posZ

$posZ : float

Type

float — Z position

$width

$width : float

Type

float — Width

$height

$height : float

Type

float — Height

$horizontalAlign

$horizontalAlign : string

Type

string — Horizontal alignment

$verticalAlign

$verticalAlign : string

Type

string — Vertical alignment

$scale

$scale : float

Type

float — Scale

$visible

$visible : boolean

Type

boolean — Visibility

$rotation

$rotation : float

Type

float — Rotation

$classes

$classes : array<mixed,string>

Type

array<mixed,string> — Style classes

$dataAttributes

$dataAttributes : array<mixed,mixed>

Type

array<mixed,mixed> — Data attributes

$text

$text : string

Type

string — Text

$textId

$textId : string

Type

string — Text ID

$textPrefix

$textPrefix : string

Type

string — Text prefix

$textEmboss

$textEmboss : boolean

Type

boolean — Text emboss

$translate

$translate : boolean

Type

boolean — Translate text

$maxLines

$maxLines : integer

Type

integer — Maximum lines

$opacity

$opacity : float

Type

float — Opacity

$action

$action : string

Type

string — Action

$actionKey

$actionKey : integer

Type

integer — Action key

$url

$url : string

Type

string — Url

$urlId

$urlId : string

Type

string — Url ID

$manialink

$manialink : string

Type

string — Manialink

$manialinkId

$manialinkId : string

Type

string — Manialink ID

$autoNewLine

$autoNewLine : boolean

Type

boolean — Automatic new line

$lineSpacing

$lineSpacing : float

Type

float — Line spacing

$scriptEvents

$scriptEvents : boolean

Type

boolean — Script events usage

$scriptAction

$scriptAction : string

Type

string — Script action

$scriptActionParameters

$scriptActionParameters : array<mixed,string>

Type

array<mixed,string> — Script action parameters

$style

$style : string

Type

string — Style

$textSize

$textSize : integer

Type

integer — Text size

$textFont

$textFont : string

Type

string — Text font

$textColor

$textColor : string

Type

string — Text color

$areaColor

$areaColor : string

Type

string — Area color

$focusAreaColor

$focusAreaColor : string

Type

string — Focus area color

Methods

create()

create(string  $controlId = null) : static

Create a new Control

Parameters

string $controlId

(optional) Control Id

Returns

static

__construct()

__construct(string  $controlId = null) 

Construct a new Control

Parameters

string $controlId

(optional) Control Id

getId()

getId() : string

Get the Id

Returns

string

setId()

setId(  $controlId) : static

Set the Id

Parameters

$controlId

Returns

static

checkId()

checkId() : string

Check and return the Id

Returns

string

getX()

getX() : float

Get the X position

Returns

float

setX()

setX(float  $posX) : static

Set the X position

Parameters

float $posX

Horizontal position

Returns

static

getY()

getY() : float

Get the Y position

Returns

float

setY()

setY(float  $posY) : static

Set the Y position

Parameters

float $posY

Vertical position

Returns

static

getZ()

getZ() : float

Get the Z position

Returns

float

setZ()

setZ(float  $posZ) : static

Set the Z position

Parameters

float $posZ

Depth

Returns

static

setPosition()

setPosition(float  $posX, float  $posY, float  $posZ = null) : static

Set the Control position

Parameters

float $posX

Horizontal position

float $posY

Vertical position

float $posZ

(optional) Depth

Returns

static

getWidth()

getWidth() : float

Get the width

Returns

float

setWidth()

setWidth(float  $width) : static

Set the width

Parameters

float $width

Control width

Returns

static

getHeight()

getHeight() : float

Get the height

Returns

float

setHeight()

setHeight(float  $height) : static

Set the height

Parameters

float $height

Control height

Returns

static

setSize()

setSize(float  $width, float  $height) : static

Set the size

Parameters

float $width

Control width

float $height

Control height

Returns

static

getHorizontalAlign()

getHorizontalAlign() : string

Get the horizontal alignment

Returns

string

setHAlign()

setHAlign(string  $horizontalAlign) : static

Set the horizontal alignment

Parameters

string $horizontalAlign

Horizontal alignment

Returns

static

setHorizontalAlign()

setHorizontalAlign(string  $horizontalAlign) : static

Set the horizontal alignment

Parameters

string $horizontalAlign

Horizontal alignment

Returns

static

getVerticalAlign()

getVerticalAlign() : string

Get the vertical alignment

Returns

string

setVAlign()

setVAlign(string  $verticalAlign) : static

Set the vertical alignment

Parameters

string $verticalAlign

Vertical alignment

Returns

static

setVerticalAlign()

setVerticalAlign(string  $verticalAlign) : static

Set the vertical alignment

Parameters

string $verticalAlign

Vertical alignment

Returns

static

setAlign()

setAlign(string  $horizontalAlign, string  $verticalAlign) : static

Set the horizontal and the vertical alignment

Parameters

string $horizontalAlign

Horizontal alignment

string $verticalAlign

Vertical alignment

Returns

static

centerAlign()

centerAlign() : static

Center the alignment

Returns

static

resetAlign()

resetAlign() : static

Reset the alignment

Returns

static

clearAlign()

clearAlign() : static

Clear the alignment

Returns

static

getScale()

getScale() : float

Get the scale

Returns

float

setScale()

setScale(float  $scale) : static

Set the scale

Parameters

float $scale

Control scale

Returns

static

getVisible()

getVisible() : boolean

Get the visibility

Returns

boolean

setVisible()

setVisible(boolean  $visible) : static

Set the visibility

Parameters

boolean $visible

If the Control should be visible

Returns

static

getRotation()

getRotation() : float

Get the rotation

Returns

float

setRotation()

setRotation(float  $rotation) : static

Set the rotation

Parameters

float $rotation

Control rotation

Returns

static

getClasses()

getClasses() : array<mixed,string>

Get style classes

Returns

array<mixed,string>

addClass()

addClass(string  $class) : static

Add a new style class

Parameters

string $class

Style class

Returns

static

addClasses()

addClasses(array<mixed,string>  $classes) : static

Add new style classes

Parameters

array<mixed,string> $classes

Style classes

Returns

static

removeAllClasses()

removeAllClasses() : static

Remove all style classes

Returns

static

hasDataAttribute()

hasDataAttribute(string  $name) : boolean

Check if a data attribute is set

Parameters

string $name

Name

Returns

boolean

getDataAttribute()

getDataAttribute(string  $name) : mixed

Get data attribute

Parameters

string $name

Name

Returns

mixed

getDataAttributes()

getDataAttributes() : array<mixed,mixed>

Get data attributes

Returns

array<mixed,mixed>

addDataAttribute()

addDataAttribute(string  $name, mixed  $value) : static

Add data attribute

Parameters

string $name

Name

mixed $value

Value

Returns

static

addDataAttributes()

addDataAttributes(array<mixed,mixed>  $dataAttributes) : static

Add multiple data attributes

Parameters

array<mixed,mixed> $dataAttributes

Data attributes

Returns

static

setDataAttributes()

setDataAttributes(array<mixed,mixed>  $dataAttributes) : static

Set data attributes (replacing all previous attributes)

Parameters

array<mixed,mixed> $dataAttributes

Data attributes

Returns

static

removeDataAttribute()

removeDataAttribute(string  $name) : static

Remove data attribute

Parameters

string $name

Name

Returns

static

removeAllDataAttributes()

removeAllDataAttributes() : static

Remove all data attributes

Returns

static

getScriptFeatures()

getScriptFeatures() : array<mixed,\FML\Script\Features\ScriptFeature>

Get the Script Features

Returns

array<mixed,\FML\Script\Features\ScriptFeature>

addScriptFeature()

addScriptFeature(\FML\Script\Features\ScriptFeature  $scriptFeature) : static

Add a new Script Feature

Parameters

\FML\Script\Features\ScriptFeature $scriptFeature

Script Feature

Returns

static

addScriptFeatures()

addScriptFeatures(array<mixed,\FML\Script\Features\ScriptFeature>  $scriptFeatures) : static

Add new Script Features

Parameters

array<mixed,\FML\Script\Features\ScriptFeature> $scriptFeatures

Script Features

Returns

static

removeScriptFeatures()

removeScriptFeatures() : static

Remove all Script Features

Returns

static

removeAllScriptFeatures()

removeAllScriptFeatures() : static

Remove all Script Features

Returns

static

addActionTriggerFeature()

addActionTriggerFeature(string  $actionName, string  $eventLabel = \FML\Script\ScriptLabel::MOUSECLICK) : static

Add a dynamic Action Trigger

Parameters

string $actionName

Action to trigger

string $eventLabel

(optional) Event on which the action is triggered

Returns

static

addMapInfoFeature()

addMapInfoFeature(string  $eventLabel = \FML\Script\ScriptLabel::MOUSECLICK) : static

Add a dynamic Feature opening the current map info

Parameters

string $eventLabel

(optional) Event on which the map info will be opened

Returns

static

addPlayerProfileFeature()

addPlayerProfileFeature(string  $login, string  $eventLabel = \FML\Script\ScriptLabel::MOUSECLICK) : static

Add a dynamic Feature to open a specific player profile

Parameters

string $login

Login of the player

string $eventLabel

(optional) Event on which the player profile will be opened

Returns

static

addUISoundFeature()

addUISoundFeature(string  $soundName, integer  $variant, string  $eventLabel = \FML\Script\ScriptLabel::MOUSECLICK) : static

Add a dynamic Feature playing a UISound

Parameters

string $soundName

UISound name

integer $variant

(optional) Sound variant

string $eventLabel

(optional) Event on which the sound will be played

Returns

static

addToggleFeature()

addToggleFeature(\FML\Controls\Control  $toggledControl, string  $labelName = \FML\Script\ScriptLabel::MOUSECLICK, boolean  $onlyShow = false, boolean  $onlyHide = false) : static

Add a dynamic Feature toggling another Control

Parameters

\FML\Controls\Control $toggledControl

Toggled Control

string $labelName

(optional) Script label name

boolean $onlyShow

(optional) If it should only show the Control but not toggle

boolean $onlyHide

(optional) If it should only hide the Control but not toggle

Returns

static

addTooltipFeature()

addTooltipFeature(\FML\Controls\Control  $tooltipControl, boolean  $stayOnClick = false, boolean  $invert = false) : static

Add a dynamic Feature showing a Tooltip on hovering

Parameters

\FML\Controls\Control $tooltipControl

Tooltip Control

boolean $stayOnClick

(optional) Whether the Tooltip should stay on click

boolean $invert

(optional) Whether the visibility toggling should be inverted

Returns

static

addTooltipLabelFeature()

addTooltipLabelFeature(\FML\Controls\Label  $tooltipLabel, string  $text, boolean  $stayOnClick = false, boolean  $invert = false) : static

Add a dynamic Feature showing a Tooltip on hovering

Parameters

\FML\Controls\Label $tooltipLabel

Tooltip Label

string $text

Text to display on the Tooltip Label

boolean $stayOnClick

(optional) Whether the Tooltip should stay on click

boolean $invert

(optional) Whether the visibility toggling should be inverted

Returns

static

addScriptText()

addScriptText(string  $scriptText, string  $label = \FML\Script\ScriptLabel::MOUSECLICK) : static

Add a custom Control Script text part

Parameters

string $scriptText

Script text

string $label

(optional) Script label name

Returns

static

render()

render(\DOMDocument  $domDocument) : \DOMElement

Render the XML element

Parameters

\DOMDocument $domDocument

DOMDocument for which the XML element should be rendered

Returns

\DOMElement

__toString()

__toString() : string

Get the string representation

Returns

string

getTagName()

getTagName() : string

Get the tag name of the Control

Returns

string

getManiaScriptClass()

getManiaScriptClass() : string

Get the ManiaScript class of the Control

Returns

string

getText()

getText() : string

Get the text

Returns

string

setText()

setText(string  $text) : static

Set the text

Parameters

string $text

Text value

Returns

static

getTextId()

getTextId() : string

Get the text id to use from Dico

Returns

string

setTextId()

setTextId(string  $textId) : static

Set the text id to use from Dico

Parameters

string $textId

Text id

Returns

static

getTextPrefix()

getTextPrefix() : string

Get the text prefix

Returns

string

setTextPrefix()

setTextPrefix(string  $textPrefix) : static

Set the text prefix

Parameters

string $textPrefix

Text prefix

Returns

static

getTextEmboss()

getTextEmboss() : boolean

Get text emboss

Returns

boolean

setTextEmboss()

setTextEmboss(boolean  $textEmboss) : static

Set text emboss

Parameters

boolean $textEmboss

If the text should be embossed

Returns

static

getTranslate()

getTranslate() : boolean

Get translate

Returns

boolean

setTranslate()

setTranslate(boolean  $translate) : static

Set translate

Parameters

boolean $translate

If the text should be translated

Returns

static

getOpacity()

getOpacity() : float

Get the opacity

Returns

float

setOpacity()

setOpacity(float  $opacity) : static

Set the opacity

Parameters

float $opacity

Opacity

Returns

static

getAction()

getAction() : string

Get the action

Returns

string

setAction()

setAction(string  $action) : static

Set the action

Parameters

string $action

Action name

Returns

static

getActionKey()

getActionKey() : integer

Get the action key

Returns

integer

setActionKey()

setActionKey(integer  $actionKey) : static

Set the action key

Parameters

integer $actionKey

Action key

Returns

static

getUrl()

getUrl() : string

Get the url

Returns

string

setUrl()

setUrl(string  $url) : static

Set the url

Parameters

string $url

Link url

Returns

static

getUrlId()

getUrlId() : string

Get the url id to use from Dico

Returns

string

setUrlId()

setUrlId(string  $urlId) : static

Set the url id to use from Dico

Parameters

string $urlId

Url id

Returns

static

getManialink()

getManialink() : string

Get the manialink

Returns

string

setManialink()

setManialink(string  $manialink) : static

Set the manialink

Parameters

string $manialink

Manialink name

Returns

static

getManialinkId()

getManialinkId() : string

Get the manialink id to use from Dico

Returns

string

setManialinkId()

setManialinkId(string  $manialinkId) : static

Set the manialink id to use from Dico

Parameters

string $manialinkId

Manialink id

Returns

static

getAutoNewLine()

getAutoNewLine() : boolean

Get auto new line

Returns

boolean

setAutoNewLine()

setAutoNewLine(boolean  $autoNewLine) : static

Set auto new line

Parameters

boolean $autoNewLine

If the Element should insert new lines automatically

Returns

static

getLineSpacing()

getLineSpacing() : float

Get line spacing

Returns

float

setLineSpacing()

setLineSpacing(float  $lineSpacing) : static

Set line spacing

Parameters

float $lineSpacing

Line spacing

Returns

static

getMaxLines()

getMaxLines() : integer

Get the maximum number of lines

Returns

integer

setMaxLines()

setMaxLines(integer  $maxLines) : static

Set the maximum number of lines

Parameters

integer $maxLines

Maximum number of lines

Returns

static

getScriptEvents()

getScriptEvents() : boolean

Get script events

Returns

boolean

setScriptEvents()

setScriptEvents(boolean  $scriptEvents) : static

Set script events

Parameters

boolean $scriptEvents

If script events should be enabled

Returns

static

getScriptAction()

getScriptAction() : string

Get script action

Returns

string

setScriptAction()

setScriptAction(string  $scriptAction, array  $scriptActionParameters = null) : static

Set script action

Parameters

string $scriptAction

Script action to be triggered

array $scriptActionParameters

(optional) Script action parameters

Returns

static

getScriptActionParameters()

getScriptActionParameters() : array<mixed,string>

Get script action parameters

Returns

array<mixed,string>

setScriptActionParameters()

setScriptActionParameters(array  $scriptActionParameters = null) : static

Set script action parameters

Parameters

array $scriptActionParameters

(optional) Script action parameters

Returns

static

getStyle()

getStyle() : string

Get the style

Returns

string

setStyle()

setStyle(string  $style) : static

Set the style

Parameters

string $style

Style name

Returns

static

getTextSize()

getTextSize() : integer

Get the text size

Returns

integer

setTextSize()

setTextSize(integer  $textSize) : static

Set the text size

Parameters

integer $textSize

Text size

Returns

static

getTextFont()

getTextFont() : string

Get the text font

Returns

string

setTextFont()

setTextFont(string  $textFont) : static

Set the text font

Parameters

string $textFont

Returns

static

getTextColor()

getTextColor() : string

Get the text color

Returns

string

setTextColor()

setTextColor(string  $textColor) : static

Set the text color

Parameters

string $textColor

Text color

Returns

static

getAreaColor()

getAreaColor() : string

Get the area color

Returns

string

setAreaColor()

setAreaColor(string  $areaColor) : static

Set the area color

Parameters

string $areaColor

Area color

Returns

static

getAreaFocusColor()

getAreaFocusColor() : string

Get the area focus color

Returns

string

setAreaFocusColor()

setAreaFocusColor(string  $areaFocusColor) : static

Set the area focus color

Parameters

string $areaFocusColor

Area focus color

Returns

static

addClockFeature()

addClockFeature(boolean  $showSeconds = true, boolean  $showFullDate = false) : static

Add a dynamic Feature showing the current time

Parameters

boolean $showSeconds

(optional) If the seconds should be shown

boolean $showFullDate

(optional) If the date should be shown

Returns

static