-
Notifications
You must be signed in to change notification settings - Fork 8
Animation Widget
Marcus Mascord edited this page Jul 11, 2014
·
2 revisions
This is a rectangle that can display animations. The animation might be a simple ticker or scroll, or it could be a 2d game.
All the widget being animated, sprites, are contained within this widget. This is a container widget. Any other widget can be animated.
The attributes for the Animation widget are:
Attribute | Type | Description |
---|---|---|
m | Widget | The main Widget Class. |
s | WidgetStyle | The style of the widget. |
clickAction | Function | This is a function that is called when a user taps on the fragment. The function signature is function(Animation Widget, x position of user tap, y position of user tap)
|
animate | Function | This is a function that is called on each animation loop. The signature of this function is animate(context for HTML5 canvas tag, x position, y position, Animation widget)
|
playAnimation | Boolean | When true the animation is being played, when false the animation is not being played. |
animationTimeout | Integer | This sets the animation interval the screen is redrawn in milliseconds. Default is 33 milliseconds, this is the standard to trick the eyes for smooth animation. This is only a reference, if each screen takes longer than 33 milliseconds to draw than the value will actually be higher. |
redrawAll | Boolean | When true the whole screen is drawn not just the animation area. When this is set to true only the animation area is redrawn. The default is false. |
collisions | CollisionDetection | Stores the possible collisions within this animation. |