Binding Variables To Properties - WorkAdventure Documentation
Binding Variables To Properties - WorkAdventure Documentation
Megaphone
Build your Map with Tiled Extra Features Binding Variables to Properties
Context
Entity collections file format
Configuration
Build your Map with Tiled
Binding Variables to Properties About bindings
About WorkAdventure maps Using the Scripting API Extra library, you can bind your variables values directly into properties on your map.
Meeting rooms
Let's imagine you want to dynamically change the URL of a co-website based on a variable value. You can create a new variable named
Special zones "myWebsiteUrl" and bind it to the openWebsite property of your co-website layer.
Animations
Integrated websites
Camera
Chat zones
Extra Features
Adding doors
Action Layers
Properties Reference
Troubleshooting
Context
You can use template properties in:
CAUTION
To use bindings with area objects, you must first set the "dynamic" property to true.
It should be noted that "dynamic" areas are accessible via the scripting API but are not editable in the (upcoming) map editor.
Configuration
Binding variables to properties can make your map reactive to variable changes, but you still need to find a way to modify the values of
variables. There are plenty of ways to do this, including:
About bindings
Use {{{ variableName }}} to refer to a variable name.
Behind the scene the Mustache templating engine is used. This means you can use all the features of Mustache like conditional:
openWebsite: {{#enableWebsite}}https://example.com{{/enableWebsite}}
The website above will be displayed only if the enableWebsite variable is set to true .
CAUTION
Be sure to use {{{ variableName }}} for binding variable and NOT {{ variableName }} . The version with a double curly-
braces will work most of the time, but it escapes HTML characters (which is not needed in properties of a map) and this might
cause weird behaviours (like breaking URLs)
If this custom property is set, it will override the "Visible" property of the layer.
If you bind it to a variable, you can display or hide a layer based on the value of a variable.
Therefore, {{^holeInWall}}1{{/holeInWall}} will return "1" when the value of holeInWall is false, and will be empty otherwise.
Previous Next
« Map configuration screen Action Layers »