shikshake Posted June 10, 2016 Share Posted June 10, 2016 Is there any way to manually add frames from an atlas to an animation by specifying x,y,length,width? I don't want to bother with json/xml files, they're frustrating to work with, Link to comment Share on other sites More sharing options...
gnoof Posted June 10, 2016 Share Posted June 10, 2016 You should never really need to think about JSON/XML files if you use a texture atlas generator, which will take away your frustrations. It will just generate the JSON/XML for you and you can just call the sprite by name, without worrying about x, y, width etc. I'd recommend TexturePacker or if you want a free solution this looks like it will do the job: Texture Atlas Creator Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted June 10, 2016 Share Posted June 10, 2016 http://renderhjs.net/shoebox/ Link to comment Share on other sites More sharing options...
LTNGames Posted June 10, 2016 Share Posted June 10, 2016 I'd recommend shoebox as well, It has many good tools in it but you need to config the settings for Phaser. Here is a tutorial to set it up for Phaser . http://anhnt.ninja/2015/08/21/phaser-performance-in-a-shoebox/ Link to comment Share on other sites More sharing options...
PhaserEditor2D Posted June 10, 2016 Share Posted June 10, 2016 19 hours ago, shikshake said: Is there any way to manually add frames from an atlas to an animation by specifying x,y,length,width? I don't want to bother with json/xml files, they're frustrating to work with, Maybe you can try with an asset manager like the one provided in Phaser Editor (dealing with atlas is lot easier). You can create the atlas and load it in the game very easy. Even in the JS editor you can auto-complete the frame names and pre-visualize it. and very soon it will get a scene builder so you will create the sprites animations in an assisted and visual way. (Image: smart coding assist shows the atlas frames and a preview of them) (Image: you can create your atlas textures with the built-in atlas generator) Link to comment Share on other sites More sharing options...
PhaserEditor2D Posted June 10, 2016 Share Posted June 10, 2016 By the way, you also have the option to avoid using XML/JSON and load spritesheets, via: game.load.spritesheet(...) Just that you have to pack the texture yourself, but it is easy. Then you create the animations by passing the frame indexes: var sprite = game.add.sprite(0, 0, "dino"); sprites.animations.add("my-anim", [0, 1, 2]); In the mentioned editor you can do it very easy too (Image: Asset pack editor and preview of spritesheet) Link to comment Share on other sites More sharing options...
BdR Posted June 10, 2016 Share Posted June 10, 2016 There are many tools to create a spritesheet (aka sprite atlas or sprite texture), see this thread: What Spritesheet toolkit does everyone use? Personally, I use the Leshy SpriteSheet Tool. But more importantly; what are you trying now to create animations, can you give your code example? And what exactly do you find frusting about working with json/xml files? Link to comment Share on other sites More sharing options...
shikshake Posted June 11, 2016 Author Share Posted June 11, 2016 3 hours ago, BdR said: There are many tools to create a spritesheet (aka sprite atlas or sprite texture), see this thread: What Spritesheet toolkit does everyone use? Personally, I use the Leshy SpriteSheet Tool. But more importantly; what are you trying now to create animations, can you give your code example? And what exactly do you find frusting about working with json/xml files? I'm using Kenney's assets (http://kenney.nl/assets) and his xml files have the wrong coordinates for the spritesheet it's assigned to. I wanted to use the spritesheet anyway, but since that isn't possible I'll just stick them together manually. Link to comment Share on other sites More sharing options...
BdR Posted June 11, 2016 Share Posted June 11, 2016 7 hours ago, shikshake said: I'm using Kenney's assets (http://kenney.nl/assets) and his xml files have the wrong coordinates for the spritesheet it's assigned to. I wanted to use the spritesheet anyway, but since that isn't possible I'll just stick them together manually. ?? If the assets you bought(?) are unusable, you should contact them and ask if their files are incorrectly formatted or if you are using them incorrect or something. Alternatively, can't you just cut out the individual sprites you want to use (or all) and save them as separate .png files. And then drop them into Leshy SpriteSheet Tool or Shoebox? Then you have your correct sprite sheet. Link to comment Share on other sites More sharing options...
Recommended Posts