Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by Joncom

Is there a way to create a new animation and initialize it with its timer thinking it has existed for 1/60th of a second. I don't want all my animations to do this, just one.

This is different than starting on a particular frame. That's not what I want to do.

Here's an example:

var as = new ig.AnimationSheet( 'media/tiles.png', 16, 16 );
this.backgroundAnims = {
    'media/tiles.png': {
        0: new ig.Animation( as, 0.2, [0,1,2,3,4] ),
        5: new ig.Animation( as, 0.2, [5,6,7,7,8] )
    }
};

I want the first animation to change 1/60th of a second before the second one.

1 decade ago by dominic

You can jump to a fraction of frame as well. I.e. if one frame is 0.2 seconds long and you want to advance 1/60 of a second:

// Jump to frame 0.0833
this.backgroundAnims['media/tiles.png'][0].gotoFrame( (1/60)/0.2 ); 

1 decade ago by Joncom

Sometimes I want to hug you Dominic. Thanks.
Page 1 of 1
« first « previous next › last »