javascript - How to change speed of a sprite animation on Spritely? -
javascript - How to change speed of a sprite animation on Spritely? -
i've been reading spritely documentation on , on , can't find solution.
i have sprite made of 4 frames. want animate endlessly each iteration : 1st frame @ 99 ms , next 3 frames @ 11ms.
how accomplish slow downwards on first frame?
the syntaxe doing isn't clear @ , i've tried failed.
thanks in advance help :)
$('#test') .sprite({fps: 6, no_of_frames: 4}) });
from able find, of calls allow speed, random instance. illustration give:
$('#bird') .sprite({fps: 8, no_of_frames: 3}) .sprandom({ top: 70, left: 100, right: 200, bottom: 340, speed: 4000, pause: 3000 });
allows speed. sprite phone call appears not to. other speed attribute appears on backgrounds, might worth shot. example:
$('#trees').pan({fps: 30, speed: 2, dir: 'left'});
or
$('#hills').spspeed(20);
as far sec part of question, sprites can whatever on n frame on_frame function. again, per documentation:
on_frame: { // note - on_frame object not function 8: function(obj) { // called on frame 8 obj.spstate(2); // alter state 2 (row 2) on frame 8 }, 16: function(obj) { // called on frame 16 obj.spstate(3); // alter state 3 (row 3) on frame 16 } }
javascript jquery
Comments
Post a Comment