Skip to main content

Actions and steps

Whenever you want to change any control property you need to take an action. Actions are grouped into steps.

Steps

Steps are defined by title and duration

Simple step could look like this:

box id: myBox size: [2,2]
step: 'this is my step title' duration: 2s
myBox -> (100,50)

Above step has title and takes 2 seconds to run. It consists of one action moving control myBox at position (100, 50)

Sequential and parallel actions

Every step can have sequential and parallel actions or both

sequential actions

To create two sequential actions in one step you need to declare them in new line e.g below example first moves myBox to point (50,-100), next otherControl is moved by +(200,0)

note

absolute move to point (x,y) and relative move by point +(x,y) have same end effect here

 step: 'sequential actions'
myBox -> (50,-100)
otherControl -> +(200,0)

parallel actions

Here we we define one step with two actions done in parallel: myBox is moved to (50,-100) and otherControl is moved by 200 units right at the same time

 step: 'parallel actions'
myBox -> (50,-100), otherControl -> +(200,0)

parallel and sequential actions

Now lets try to mix both in one step.

First myBox is moved to (50,-100) and otherControl moved by +(200,0) at the same time and finally otherControl and myBox swap positions

step: 'parallel and sequential actions'
myBox -> (50,-100), otherControl -> +(200,0)
otherControl <-> myBox