Some posts ago we showed how to use KeyframeAnimation in the normal way. That is by making a SpriteSheet image and using separate areas from that image as separate frames in the animation. But theres a bit more in it. The ‘addFrame()’ method can actually accept any kind of fills. Depending on what you wish to achieve this may give you a way to have some animating objects without using lot of images.
Please note that following can not be counted as a major feature of LimeJS but rather a side effect that we are happy about.
Starting with the simplest fill types here is the animation using plain colors as fills. All syntax is the same. Just pass the color name to the ‘addFrame()’ method.
1 2 3 4 5
var sprite = new lime.RoundedRect().setRadius(10).setSize(50,50).setPosition(100,200); layer.appendChild(sprite); var anim = new lime.animation.KeyframeAnimation().setDelay(.5). addFrame('#c00').addFrame('#0c0').addFrame('#00c'); sprite.runAction(anim);