Jump to content

Loading spritesheet via texture atlas.


Oliganti
 Share

Recommended Posts

I'm trying to convert my spritesheet animations into 1 bigger texture atlas. I want to avoid calling load Texture every click (swinging weapon). The problem is I can't find the way to provide frameData for my animation. I load 3 images to texture atlas and then I have 3 frames after export.

 

How I can tell that there are 4 frames in 1 texture atlas sprite? 

I used to write like this: 

this.loadTexture(toolName + side, 0);

Any ideas?

Link to comment
Share on other sites

Lester advised me to cut my spritesheets into frames. I have thought that there might be solution to upload whole spritesheet as a one frame into texture atlas and then to tell Phaser how it should be parsed. 

 

The solution for that problem is to slice all spritesheet manually into particular frames and then pack everything again.

Link to comment
Share on other sites

This is definitely the right way to do it. You could technically put the whole spritesheet into your atlas and manually define where the frames are in the atlas data file, but that's probably more work than just cutting up your spritesheet, plus the tools used to build atlases tend to give more optimal use of space by packing the individual frames efficiently.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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