Options
All
  • Public
  • Public/Protected
  • All
Menu

Cospaces Edu scripting API

CoSpaces Edu supports Typescript to allow you create advanced, interactive experiences! This feature is available for all CoSpaces Edu PRO users.

version 1.1

Changes in 1.1

  • Added creation methods for anisotropic items in Scene.
  • Added VideoItem controls.

Getting started

To add scripts to your Scene, click the Code - button in the toolbar and select script. To run your scripts, press the Play - button in the toolbar (see example).

  • You can add up to 5 script tabs per Scene.
  • Scripts run in the script-tab-order in which they were added in (left to right).
  • Update loops can be defined with Time methods.

Working with items

Items in CoSpaces Edu are categorized by different interfaces based on functionality. BaseItem is the base item class which exposes core item functionality. Child interfaces such as the AnimatedItem add additional methods and properties.

  • To find items in a Scene, use Scene.getItem
  • Optionally, you can cast items to child a interface (e.g. AnimatedItem) to expose additional methods and properties (see example).

Event handlers

Event handlers allow you to create triggers for inputs, collisions, and application states. Most handlers are unique; creating a new event handler of the same kind causes the previous one to be disposed.

You can create event handlers for

Generated using TypeDoc