How to use xml spritesheets in Cocos2d-x?

Hello!

I’m willing to test this GUI set: http://opengameart.org/content/ui-pack-rpg-extension
It comes with an XML file with “TextureAtlas” tags. You can check it here: http://pastebin.com/TaL8nuD9
I see Cocos2d-x has a class called the same way, but I’m not sure how to use it.

To sum up: Which is the proper way to load that spritesheet so I can use that GUI set?

Thanks! :grin:

A little bump if you allow me :blush:

just drop the png’s into TexturePacker and let it do the work for you.

Hi @slackmoehrle, thanks for taking a look at the thread.

As I say in my first message, I already have an XML file with the data.
My questions are:

  1. Can I use the XML file I have directly in Cocos2d-x?

If that format is not supported,
2. Is there any free as in freedom tool to create Cocos2d-x accepted format sprite sheets?

I did a little research myself but I couldn’t find anything.

Cheers =)

There are a few different spritesheet creators that are free. Cocos Studio can accomplish this, as can Creator. Also I think there is shoebox and search these forums, a user wrote a tool, just a few months ago.

Hello again, @slackmoehrle

I’m a GNU/Linux user. I can’t use neither Cocos Studio nor Creator, nor Shoebox.
I can’t find the tool you say in the forums, neither.
Do you remember the thread? I’m really interested.

Is there any documentation about which formats cocos2d-x accept? Please, enlighten me a little bit.

Thank you.

I don’t know what we support in terms of XML. The only thing that comes to mind is TMX stuff.

But, you could use TinyXML. I have used it in the past when I have needed to deal with XML.