User Tools

Site Tools



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 (7 months 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>
 +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_inheritance_prefixes.txt ยท Last modified: 2019/03/07 01:37 (7 months ago) by sausage