User Tools

Site Tools


Inheriting Animations using Prefixes

This is an advanced tutorial in order to explain how to reuse existing Animations, but using Prefixes to give meaningful names to the new animations, while being able to make minimal changes to the the new animation.

If you don't know how to use the Animation System, visit this guide first: Animation Walk-through

A Standard Animation

Consider the following example:

Texture     = bonus.png
FrameSize   = (16, 16)
Pivot       = center
KeyDuration = 0.1
StartAnim = Loop
Loop = 8
Destroy = 8
Loop-> = Loop # .!Destroy
Destroy-> =
KeyDuration = 3
BlendMode = add

We can now set the KeyDuration for the first frame of Loop as well as the BlendMode for the whole Destroy animation and it'll get carried away even for animation sets based on this one using a prefix, such as the following:

An Inherited Animation

Prefix = BonusBomb

TextureOrigin = (0, 16)

TextureOrigin = (128, 16)

By setting Prefix = BonusBomb, properties like BonusBombLoop will refer to the inherited Loop property.

And now. where we simply override the TextureOrigin for both animation BonusBombLoop and BonusBombDestroy but we'll inherit the KeyDuration and BlendMode that we previously set in Loop and Destroy.

This takes a few minutes to get the hang off, but it is amazingly powerful.

en/tutorials/animation/animation_inheritance_prefixes.txt · Last modified: 2020/08/20 11:49 (4 years ago) by