Native commands
Once we have our Clip constructed is time for the action. MotorCortex provides all of the necessary methods to execute a Clip. These methods are provided onlyby the hosted Clips as hosted Clips are the only Incidents that can be executed.
Hosted Clips are the top-level Clips that take the host property. More on that later on.
The methods provided are the following:
(hosted) Clip:
- play(): starts execution of the Clip from the current millisecond
- pause(): pauses execution of the Clip. You can resume by play()
- set executionSpeed (setter / executionSpeed = <whatever>): sets the speed execution of the Clip. Can be any positive or negative number
For seeking on the Clip there is a special Class provided by the MC API, the “TimeCapsule”.
The TimeCapsule accepts a hosted Clip on construction and then you can make a journey in time via it. The syntax (by example) is:
const TimeCapsule = new MotorCortex.TimeCapsule();
const journey = TimeCapsule.startJourney(myClip);
journey.station(500);
journey.station(700);
journey.destination();