Scripting Reference

How to Use

To begin writing your custom scripts go to the ‘Scripts’ tab and click the ‘New Script’ button. In the property panel on the right hand side you can give the script a name, and select which event trigger you would like to trigger this script.

  • Load - Will run the script when the object loads in the app
  • Destroy - Will run when the object is removed from the app
  • Tap/Click - Will run when a user taps on the object
  • Complete - Will run when the object has completed its animation, or video/audio have played through.

You can now write your code using JavaScript with access to the global JavaScript context. Many of the Plattar specific objects are hidden but can be accessed through the provided APIs that are listed in detail later in this guide.

Now you can go to your scene/page in the Plattar CMS to add these scripts to the Plattar Objects. You can attach the scripts by selecting the objects and looking for the Scripted Events property in the property panel. The following objects can have scripts added to them:

  • Page
  • Card Button
  • Action Button
  • Scene Model
  • Scene Button
  • Scene Video
  • Scene Audio

how to use writing for the 3d layer writing for the 2d layer storing memory and passing data between layers