Jump to content

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

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