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

$children

$children : array<mixed,\FML\Types\Renderable>

Type

array<mixed,\FML\Types\Renderable> — Children

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

getChildren()

getChildren() : array<mixed,\FML\Types\Renderable>

Get the children

Returns

array<mixed,\FML\Types\Renderable>

add()

add(\FML\Types\Renderable  $child) : static

Add a new child

Parameters

\FML\Types\Renderable $child

Child Control to add

Returns

static

addChild()

addChild(\FML\Types\Renderable  $child) : static

Add a new child

Parameters

\FML\Types\Renderable $child

Child Control to add

Returns

static

addChildren()

addChildren(array  $children) : static

Add new children

Parameters

array $children

Child Controls to add

Returns

static

removeChildren()

removeChildren() : static

Remove all children

Returns

static

removeAllChildren()

removeAllChildren() : static

Remove all children

Returns

static

getFormat()

getFormat(boolean  $createIfEmpty = true) : \FML\Elements\Format

Get the Format

Parameters

boolean $createIfEmpty

If the format should be created if it doesn't exist yet

Returns

\FML\Elements\Format

setFormat()

setFormat(\FML\Elements\Format  $format = null) : static

Set the Format

Parameters

\FML\Elements\Format $format

New Format

Returns

static