Skip to content

Data Type ​

Strict typing has been introduced in the layout (definitions parameters, scope properties), type checking occurs at the execution stage (except for macros, for them at the substitution stage, i.e. at the parsing stage)

The introduction of typing allows for better error control.

TypeDescriptionSyntaxNote
numbernumber12.34for the number type you can specify units
percent12.34%
pixels12px
boolboolean expressiontrue / false
strstring'text123'single quotes
dictdictionary{a: 1, b: 2}
arrayarray[1, 2, 3]
expressionexpression to be calculateda ? 1 : 2in double quotes
constant cannot be defined in expressions
gfxpointer to any GFx::Value-constant cannot be defined in markups and in expressions
cppa complex object such as a collection or entity-

NOTE

An important feature when working with string literals and variables is that single quotes can be omitted, since the parser interprets the values as a string when parsing. Therefore, there is duality when declaring string variables.

Example
python
# Initialize variable variable with string
(var vehicleName:str = Skorpion)
  
  
# Declare key in dict
(var testDict:dict = "{
    up : 'bitmap:button_black_bg',
    hover : 'bitmap:button_black_bg_hover',
    down : 'bitmap:button_black_press'
}")
(trace "toUpper(testDict['up'])")