-
Notifications
You must be signed in to change notification settings - Fork 6
Custom Variables
Avetis edited this page Nov 6, 2015
·
2 revisions
In order to have flexibility in configuration you can set custom variable key/value pair to any item. The possible use cases are for example setting a running speed to your character or some other value that should later be used in code to affect item behaviour.
When you have a variable set to an item from the editor, it's easy to retrieve it, given your item has id or tag to find it.
var car = sl.getRoot().getChild("car");
var carSpeed = Std.parseInt(car.getCoreData().getVar("speed"));