-
Notifications
You must be signed in to change notification settings - Fork 1
Functions
When you're in the script.json file, you can see a functions area. In that area you can write a function. In this example our function will be called "foo".
"functions": {
"add_to_foo": {
"args": {},
"execute": []
}
},Once you have your function, you probably want to do something with it. You can do everything that is doable. In our example we are going to add to a variable and then switch to a scene from the variable.
{
"global_variables": {
"foo": 1
},
"functions": {
"add_to_foo": {
"args": {},
"execute": [
["add", "foo", 2],
["scene", "foo"]
]
}
},Having arguments in functions is sometimes really needed. Imagine a lose function, but you can't set a reason why someone lost! That would be bad. That's why we added arguments! Arguments must always start with a capital letter and can't contain spaces. Calling an argument is simple! When in a string input, always use {arg:<YourArgNameHere>} and when in any other input just hope for the best and write the argument name.
{
"global_variables": {
"foo": 1
},
"functions": {
"add_to_foo": {
"args": {"AddAmount": 1},
"execute": [
["add", "foo", "AddAmount"],
["scene", "foo"]
]
}
},Changing the arguments is also really easy. Click on a button where you want to execute the function and click on Function arguments and then change the argument that you want to change.

Executing functions is super easy. Just click on a button, then in Button action select Script, and then in Script function select the function that you want to execute. In our case it is add_to_foo.
You want to check if a variable has a specific value? Read checks
Support, issues or feature requests? Click here
- Settings
- Custom theme (coming soon)
- Project
- Creating project (coming soon)
- Open project (coming soon)
- Bookmark project (coming soon)
- Editor
- Buttons (coming soon)
- Scenes (coming soon)
- Texts (coming soon)
- Build/play Game (coming soon)

