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:
- DABL
- HTML
box id: myBox size: [2,2]
step: 'this is my step title' duration: 2s
myBox -> (100,50)
<dot-and-box controls style="height: 250px" code="
box id: myBox size: [2,2]
step: 'this is my step title' duration: 2s
myBox -> (100,50)">
</dot-and-box>
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)
absolute move to point (x,y) and relative move by point +(x,y) have same end effect here
- DABL
- HTML
step: 'sequential actions'
myBox -> (50,-100)
otherControl -> +(200,0)
<dot-and-box controls style="height: 250px" code="
box id: myBox at: [-3,-2] size: [2,1]
box id: otherControl at: [-3,0] size: [2,1]
step: 'sequential actions'
myBox -> (50,-100)
otherControl -> +(200,0)">
</dot-and-box>
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
- DABL
- HTML
step: 'parallel actions'
myBox -> (50,-100), otherControl -> +(200,0)
<dot-and-box controls style="height: 250px" code="
box id: myBox at: [-3,-2] size: [2,1]
box id: otherControl at: [-3,0] size: [2,1]
step: 'parallel actions'
myBox -> (50,-100), otherControl -> +(200,0)
">
</dot-and-box>
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
- DABL
- HTML
step: 'parallel and sequential actions'
myBox -> (50,-100), otherControl -> +(200,0)
otherControl <-> myBox
<dot-and-box controls style="height: 250" code="
box id: myBox at: [-3,-2] size: [2,1]
box id: otherControl at: [-3,0] size: [2,1]
step: 'parallel and sequential actions'
myBox -> (50,-100), otherControl -> +(200,0)
otherControl <-> myBox
">
</dot-and-box>