Animation
Animation
The Animation module has been create to simplify animation using javascript (for now mostly the relative animations).
The module present a simple function animate to help calculating your animation position.
Module Details
Variables (Members):
Name |
Type |
Default Value |
Description |
animationClass |
|
Array holding the main classes of the modules( |
|
animationFunctions |
|
Array holding the two main functions of the module (see the functions details below). |
Enumeration:
Name |
List |
Description |
Curves |
|
Enumerator used to defined which kind of animation you want (it will pick one of the functions above - see functions description for the difference between curves). |
Functions:
Name |
Arguments |
Return |
Description |
Animate |
|
VOID |
Animate will choose through the selected curve one of the function of the AnimationClass and make sure to correct the name if null. The call back function has to take two arguments:
If needed, the callback function can take a third argument which is extra data you need to transfer to the function (ExtraData). Note that the callback function no longer belong to the calling class when executed. |
CreateFlip |
|
Function used to create a new Flip class. |
Functions Details
LinearAnimation:
Arguments
- Integer: MaxTimeInMS - Duration of the animation in milliseconds.
- Integer: FrameRate - Animation frame rate in FPSeconds.
- Function: Function - Call back animation with two or 3 arguments (Percents, X, ExtraData).
- String: INFO_NAME - Name of the animation (debug purpose).
- Boolean: IsOtherArguments - Define if callback function need extra data.
- Class: FUNCTION_NEEDED_INFO - Extra data needed by function.
Description
Like other animation function LinearAnimation animation will calculate x position based on a advancement and sent back the info trough a callback function with arguments (Percent, X). The callback function just need to place items on there position based on X value.
The linear is simple, it is the same percent as X during the whole animation (x=y):
You can see the linear function which stay the same all along.
EaseInOutAnimation:
Arguments
- Integer: MaxTimeInMS - Duration of the animation in milliseconds.
- Integer: FrameRate - Animation frame rate in FPSeconds.
- Function: Function - Call back animation with two or 3 arguments (Percents, X, ExtraData).
- String: INFO_NAME - Name of the animation (debug purpose).
- Boolean: IsOtherArguments - Define if callback function need extra data.
- Class: FUNCTION_NEEDED_INFO - Extra data needed by function.
Description
Like other animation function LinearAnimation animation will calculate x position based on a advancement and sent back the info trough a callback function with arguments (Percent, X). The callback function just need to place items on there position based on X value.
The linear is a bit complex it use two different function (curves) cut at the middle, it first accelerate at the fastest speed then decelerate:
Created with the Personal Edition of HelpNDoc: Single source CHM, PDF, DOC and HTML Help creation