Jump to content

Texture Atlas Creator


dmitsuki
 Share

Recommended Posts

Sorry if this is the wrong board.

 

I needed to create Texture Atlases for my sprites in game, and a quick google search led me to TexturePacker.

 

However, that is not a free solution and I don't like spending money on task I can write my own code for :)

 

Before creating my own Texture atlas creator however, I stumbled upon http://spritesheetpacker.codeplex.com/

 

This tool seemed to bascially do what I wanted with the added cost of being free, but it did not output to a format readable by Phaser.

 

So I wrote a DLL to allow it to do so! Pretty easy to use. Just download spritesheetpacker and put SpriteSheetPacker.JsonExporters.txt in the same directory as the executable, and change the extension from .txt to .dll.

 

I should mention the .json file is in the hash format.

 

The JSONExporter.txt isn't neccessary, it's just source if anybody cares.

SpriteSheetPacker.JsonExporters.txt

JSONExporter.txt

Link to comment
Share on other sites

  • 5 weeks later...
  • 2 months later...

It works on linux too!

 

Here how to get it working step by step:

Once you followed the above instructions:

 

1. Install mono for linux

    sudo apt-get install mono-complete

2 Double click the exe file! That's it!

 

To output the map file to JSON format, first select the map file then the Image one.

It didn't work in the other way around for me.

 

Cheers

Antonio

  

Link to comment
Share on other sites

  • 1 year later...

I made texture atlas in Java tool long time ago. While the code inside is crappy and hardly maintainable, I am happy with it and I use it for all my games. Just now it is named SBC PicOpt, but I will probably rename it to Spritor or so in future. Anyway it is free now and it gives good results.

 

Actually it is little more than pure atlas tool. You can add custom properties to sprites and export it along with standard TP export. You can also export scaled atlas as you can set global scale on all sprites and adjust it with individual scales on every single sprite.

 

 I plan to completely rewrite it one day as I can think about tons of features...

Link to comment
Share on other sites

  • 4 months later...

We've added support for Phaser to TexturePacker - both the JSON hash and array format.

 

This gives you some additional benefits:

  • update your sprite sheets with a single click - or by adding TexturePacker to your build scripts
  • optimize the sheet using PngQuant for faster loading 
  • runs on Windows, Mac and Linux

I've also created a short tutorial - including code on GitHub: 

https://www.codeandweb.com/blog/2014/12/17/creating-spritesheets-for-phaser-with-texturepacker

Link to comment
Share on other sites

  • 4 months later...

@dmitsuki this works brilliantly, many thanks!

@GNUton's ammendment works as well, but saves as JSONArray instead of JSONHash.

 You can in fact copy both dlls (name them differently) to the Sprite Sheet Packer directory and the app will then give you both *.json and *.jsona as options to export.  I note that *.json is slightly smaller than *.jsona per sprite.

Link to comment
Share on other sites

  • 1 month later...
  • 5 months later...
  • 2 weeks later...
 Share

  • Recently Browsing   0 members

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