Oliganti Posted August 2, 2014 Share Posted August 2, 2014 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 More sharing options...
eguneys Posted August 4, 2014 Share Posted August 4, 2014 Are you using texturepacker or something like that, it exports a .json file that defines your frames. Link to comment Share on other sites More sharing options...
Oliganti Posted August 5, 2014 Author Share Posted August 5, 2014 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 More sharing options...
lewster32 Posted August 5, 2014 Share Posted August 5, 2014 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 More sharing options...
Recommended Posts