User Tools

Site Tools


en:tutorials:animation_inheritance_prefixes

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

en:tutorials:animation_inheritance_prefixes [2019/03/07 01:37 (2 weeks ago)] (current)
sausage created
Line 1: Line 1:
 +====== 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: [[en:​tutorials:​animation_walkthrough|Animation Walk-through]] ​
 +
 +
 +===== A Standard Animation =====
 +
 +Consider the following example:
 +
 +<code ini>
 +[BonusAnimSet]
 +Texture ​    = bonus.png
 +FrameSize ​  = (16, 16)
 +Pivot       = center
 +KeyDuration = 0.1
 +StartAnim = Loop
 +Loop = 8
 +Destroy = 8
 +Loop-> = Loop # .!Destroy
 +Destroy->​ =
 +
 +[Loop1]
 +KeyDuration = 3
 +
 +[Destroy]
 +BlendMode = add
 +</​code>​
 +
 +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 =====
 +
 +<​code>​
 +[BonusBombAnimSet@BonusAnimSet]
 +Prefix = BonusBomb
 +
 +[BonusBombLoop]
 +TextureOrigin = (0, 16)
 +
 +[BonusBombDestroy]
 +TextureOrigin = (128, 16)
 +</​code>​
 +
 +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_inheritance_prefixes.txt ยท Last modified: 2019/03/07 01:37 (2 weeks ago) by sausage