Thursday, December 20, 2012

Texture Packer pt 2

I got some very quick help when I posted about the Texture Packer and the changes I was making to its exporter etc. I received info from Andreas himself (the auther)..

All this addressed a couple of issues I was having.
  1. EdDiGeronimo from Twitter told me about the 'Trimmed Filenames' so I could use those and it has the '.png' removed. Less manual labour is great!
  2. EdDiGeronimo also told me about the rotation not being a variable rotation, it is in fact true or false and gets rotated by 90 degress. Depending on your exporter settings this could be CW, or CCW.
  3. I did get a notice from Andreas (@codeandweb) saying my request for multiple sprite sheet exports is in the works and will most likely be in version 3.1. SWEET! I only have a simgle sprite sheet at the moment, So no real issue, but this should chnage in a month or so.
(side note: EdDiGeronimo told me he has been using the Texture Packer for a while, and cleverly used a Python script on the output to create binary data files to use at load time. A very nice solution, but I really want the output of the exporter to be used as is, no more steps.)

I have made great progress with the exporting template now. It produces a nice '.cpp' file and I have it placed into the game code. I had a few teething syntax errors but nothing earth shattering at all. So a few quick edits and it is done. Only...

Well I really like to reference assets by UID or Defined name (usually setup from an enum or some such). So I created a section in the exporter to create a nice enum that matches the order of the atlas information. This has worked wonderfully, only now I really need to export just that section as a header file, so all my code can use it and simply call my renderSprite function with the enumerated value they want to render.
For now I will simply cut and copy this section into a hand made header file.

I have not managed to spend any time on this since Monday, otherwise I am confident it would be done. Instead I am rebuilding my kitchen and also my new Laptop has arrived, which I am busy setting up for development purposes... So I am making no progress, gah!

I'll update when I get back to coding Hoopfighter again (hopefully on the new machine and tomorrow!)

G'night
Da Voodoochief

No comments:

Post a Comment