Jump to content

Adding spritesheets into atlas


mapacarta
 Share

Recommended Posts

Is there any way to use spritesheets from an atlas like normal images? 

Currently I use:

this.load.spritesheet('coin', 
     'assets/coin.png',
     { frameWidth: 16, frameHeight: 16 }
);

 

If I pack all of the spritesheets I use into an atlas, can I use them? Normally when adding an image we can enter both key and frame value (x,y,key,frame) But when making an animation we can enter only key value:

this.anims.create( {
     key: 'coinSpin',
     frames: this.anims.generateFrameNumbers('coin', { start: 0, end: 3, first: 0 }),
     frameRate: 5,
     repeat:-1
});

 

Should I just load every spritesheets as a seperate file or is there any other way?

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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