Jump to content
This forum will be closing down. Please move to the respective dedicated project forums.

Atlas animation issue


Ninjadoodle
 Share

Recommended Posts

Hi @enpu

I'm having a bit of a problem loading an animation from an atlas. Some of the frames seem to play out of order.

This is the code I'm using to load my anim ...

game.createClass('S04Bunny', {
    
    init: function(x, y) {
        
        this.anim = game.Animation.fromTextures('s04BunnyA');
        this.anim.position.set(x, y);
        this.anim.anchorCenter();
        this.anim.speed = 5;
        this.anim.play();
        this.anim.addTo(game.scene.mg);
    }
});

Thanks in advance :)

Link to comment
Share on other sites

I think i found the issue. The native JavaScript's sort function doesn't seem to work as i thought. For example when sorting array with it number 10 comes before number 2, and that's why the animation order is not working properly.

But i found a fix for that and just pushed changes to dev branch. Let me know if it works now!

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...