Skip to content

Commit a0b1b26

Browse files
authored
Merge pull request #176 from easycoder/dev
'Animate' doc
2 parents 66c5306 + 03b7ea2 commit a0b1b26

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

action-animate.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
~page:contents:Contents~
2+
3+
# The `animate` action
4+
5+
This action a visual effect on the content of a bock. At present there is only pan/zoom, used to create the "Ken Burns" effect that makes still photos look a little like video.
6+
7+
~img:https://easycoder.github.io/iwsy/resources/help/img/animate.png|100%~
8+
9+
This action performs a visual effect on one or more blocks. Each of the blocks has content which contains a special Markdown extension that defines the visual effect to be applied. The format is
10+
11+
~m:~vfx:100% manarola~~
12+
13+
where ~m:manarola~ is the name of the effect in the ~m:VFX~ section of the script. You can have any number of animations in a single content block, though more than one is usually over-doing it.
14+
15+
The parameters needed for the effect are given by adding an item in the ~m:VFX~ section:
16+
17+
~img:https://easycoder.github.io/iwsy/resources/help/img/panzoom.png|100%~
18+
19+
Here the type is defined as a ~m:panzoom~ (it's currently the only option available). The name then follows. Next we have the aspect ratio of the container that holds the image being manipulated, the URL of that image and the duration of the effect in seconds.
20+
21+
The effect works by magnifying the image and using the container as a "window" onto a part of the magnified image. By moving the window and altering the magnification we achieve the pan and zoom effect.
22+
23+
There are 2 groups of 3 parameters, one for the start of the effect and the other for the end. Each of the sets of values are as follows:
24+
25+
1. the size (magnification).
26+
1. the offset of the left-hand edge of the image from the left-hand edge of the container. Negative values cause the image to position to the left of the container, so in general the values will all be negative or zero.
27+
1. the offset of the top edge of the image from the top of the container. Negative values cause the top of the image to position above the container.
28+
29+
In all cases the values are expressed as a percentage of the container width or height.
30+
31+
The animation follows a cosine function that causes it to start slowly, accelerate towards the middle of the effect the deccelerate towards the end, giving a smooth start and finish.
32+
33+
To use a sequence of images, each with its own Ken Burns specification, fade down the current item and fade up the next, in each case with the ~m:continue~ flag set to ~m:yes~, then follow these with the animation itself. With the right fade duration this will give you a smooth transition during the period the animation is moving at its slowest. You may also have to ensure the images are preloaded (cached) to avoid stuttering as a new animation starts.
34+
35+
You can see an example running on the ~page:iwsy:Home~ page of this documentation.
36+
37+
Next: ~page:action-pause:Pause~

iwsy/resources/help/img/panzoom.png

21.8 KB
Loading

0 commit comments

Comments
 (0)