-
Notifications
You must be signed in to change notification settings - Fork 2
Animatable
Isuru Kusumal Rajapakse edited this page Jun 18, 2017
·
1 revision
- Represents a component that defines a animatable behaviors like animate, play etc.
Void
returns the current state the sprite is in
-
statecurrent state
set the current state of the animation
| Name | Type | Description | |
|---|---|---|---|
| id | string |
- unique name of the animation to go to |
-
Spriteitself
plays the animation associated in the state (if any)
| Name | Type | Description | |
|---|---|---|---|
| fpt | string |
- sets the speed of playback [<0=slowmotion, 0=stopped, 1=normal, 1>=fastmotion] |
-
Spriteitself
stops the animation associated in the state (if any)
-
Spriteitself
rewinds the animation associated in the state (if any) rewinds to the start by default.
| Name | Type | Description | |
|---|---|---|---|
| to=0 | in |
- sets the frame to rewind to | Optional |
-
Spriteitself
sets a static layered image resources for the desired sprite important ! - the last last layer renders on top important ! - the first layer will be used as the collision mask by defult
| Name | Type | Description | |
|---|---|---|---|
| url | Array.<string> |
- location of the images layer by layer. |
-
Spriteitself
sets animated spritesheet resources for the desired sprite important ! - the last last layer renders on top important ! - the first layer will be used as the collision mask by defult
| Name | Type | Description | |
|---|---|---|---|
| name | string |
- unique name to identify each animation state | |
| urls | Array.<string> |
- location(s) of the spritesheet images layer by layer. | |
| nr | int |
- number of rows in the spritesheet | |
| nc | int |
- number of colomns in the spritesheet | |
| sf | string |
- starting frame of the said state | |
| repeat | int |
- times should the animation repeat [-1: repeat forever, 0:don't animate , 1:repeat once ...] |
-
Spriteitself
defines how the component state change on one update
Void