Spritemap with different sized sub-images?


(kgbkgb) #1

Is this supported at all ? for example i have this image http://imgur.com/OOiLP2J it obviously won’t animate properly using the default spritemap class (some frames are bigger or smaller), is there any way i can use an xml file along with this png for animation in FP ?


(Ultima2876) #2

Would be pretty useful to have a SpriteAtlas class that allows sprites of all different sizes, but as far as I know there’s no support for it yet.


(kgbkgb) #3

If I were to implement a class for the TextureAtlas, what would everyone like ? XML, JSON, or other implementation, maybe both?


(Ultima2876) #4

Probably the best way would be to write it to support something like TexturePacker directly. I believe that uses XML.


(kgbkgb) #5

I’ll see what I can come up with, I hope it’s useful for others than myself :smiley:


(Zachary Lewis) #6

Here’s a few functions that I think would be very nice.

  • Adding a single sprite.
  • Adding a list of sprites.
  • Converting XML to a list of sprites.

(Alex Larioza) #7

I’ve been working on a mobile game in Monkey, where I’ve been busy porting FlashPunk. With mobile, its important to limit the number of texture swaps, so I implemented a texture atlas class. However, I didn’t want to pay for TexturePacker so I did some research and found ShoeBox. It’s a really nifty program that has a bunch of different utilities…and its free!


(kgbkgb) #8

Would you mind releasing your Texture Atlas class ? I would hate to reinvent the wheel. Maybe I could modify it to add some extra functionality ?


FlashPunk TextureAtlas
(Ultima2876) #9

Monkey is a different language so it probably wouldn’t be all that useful.


(kgbkgb) #10

Oh I’m sorry I misunderstood. Forgive me.

In any case I’ll probably have something next week when i’m off work.


(Zachary Lewis) #11

I moved a post to an existing topic: FlashPunk TextureAtlas


(Zachary Lewis) #12

I moved a post to an existing topic: FlashPunk TextureAtlas