Structure of an Animation

While sprites are relatively complex with the collections, definitions, UV mappings etc., animations build on top of this and their structure is significantly less complicated. Animations work together with tk2dBaseSpritecomponents.

An "animation", that is, a moving picture, is accomplished by the class tk2dSpriteAnimationClip. This object contains a list of tk2dSpriteAnimationFrames, and each one of those contains the name of the sprite definition to use and some other minor details (such as whether the player should be invulnerable during this frame, if this animation is used as the player's animation).

tk2dSpriteAnimationClips combine into the tk2dSpriteAnimation class, which provides a list of clips tagged by name along with things such as the FPS that the animation should be played at. If you want to actually give a game object this animation, the final important type is a component called tk2dSpriteAnimator, which contains pretty much nothing more than a reference to the tk2dSpriteAnimation (which is not a component).

Of course, just like with sprites, Semi contains a lot of useful API features regarding animations, including a separate (but similar) format for animations, which will be shown in more detail on the next pages in this section.

Last updated