-
Notifications
You must be signed in to change notification settings - Fork 2
Style
The style class is what allows the customisation of element visuals.
See field names.
Style( Instance object )
A Style should be initialised with the object it refers to. This can be changed later with clone().
Style copy = Style:clone()
Returns a style identical to the one being operated on. Changed made to one will not affect the other.
This function is chainable.
Style:setField( string field, value )
Sets the value of a field for the style, invoking its object's setChanged() function.
value = Style:getField( string field )
Returns the value of a field for the style.
Style.addToTemplate( Class class, table fields )
Modifies the default values of a class style. fields should be formatted as follows:
{
["field"] = value_one;
["field.state"] = value_two;
}Field names are identifiers for specific attributes of a style. Some examples:
colourtextColour.pressedhorizontal-alignment.pressed
The syntax of a field name is this: identifier[.state]. When state is not given, it defaults to default, so colour is actually colour.default.
Field names are used by elements for getting colours and other values. Let's take a button as an example. The colour of the button will be determined by colour (colour.default), or colour.pressed when the user is holding the button with their mouse. The various field names are documented by each individual element.
- Exception
- DynamicValueException
- ExpressionException
- IncorrectConstructorException
- IncorrectParameterException
- ParserException
- ResourceLoadException
- ThreadRuntimeException