Animation Sprite Sheets addFrame

98 views
Skip to first unread message

Vlad

unread,
Nov 6, 2011, 3:41:29 AM11/6/11
to LimeJS HTML5 Game Framework
Dear developers of LimeJS,

for animation i use useful example from http://www.limejs.com/2011/02/21/introducing-sprite-sheets

but it is strange for me one moment ....
Why it is necessary to use "addFrame" before each play of animation?
Example of code:

test.moveToPosition = function(monster,pos){
...
// keyframe animation
var anim = new lime.animation.KeyframeAnimation();
for(var i=1;i<=7;i++){ //add the frames
anim.addFrame(test.ss.getFrame('walking-'+dir+'000'+i+'.png'));
}
monster.runAction(anim);
...
};


Is it possible to set one time a set of frames? (It will decrease
amount of work for processor before play of animation.)
And when it is necessary to call runAction() only.

thank you in advance for you answer,
Vlad

Tõnis

unread,
Nov 7, 2011, 7:00:49 AM11/7/11
to LimeJS HTML5 Game Framework
Hi

The keyframeanimation library is lacking a bit because it was mainly
designed just to simulate animated gifs.

Similar discussion and some solution suggestions are here:
http://groups.google.com/group/limejs/browse_thread/thread/4332579796309b29/c04e11afa9e5b056

If you need better start,stop,pause,resume control on
keyframeanimation you can add a feature request on the github page.

On Nov 6, 10:41 am, Vlad <vladyslav.ku...@gmail.com> wrote:
> Dear developers of LimeJS,
>
> for animation i use useful example fromhttp://www.limejs.com/2011/02/21/introducing-sprite-sheets
Reply all
Reply to author
Forward
0 new messages