Skip to main content

Posts

Showing posts from January, 2014

Automating CCB Creation

Cocos2d-x is awesome because you can use cocosbuilder for creating scenes / animations with ease. But there could be scenarios where you want to create multiple CCB (cocosbuilder files) like 1) Same animation but different images      You might want to create a large number of ccb files with different images but same animations. This could be done in the code as well but this would make it easier. 2)  Create a starting point for animation.     If you had to move the images around in the ccb but you know for sure that all the images have to be dragged into the scene and animated. So how do we do this?... Well the "CCB" files are nothing but XML files to be more precise they are PLIST  files. So all you have to do is create these XML files using a script of some sort so your manual labour is reduced. Python was the language of choice here because it's very versatile at doing things like these. I was going to use the xml Etree module for handling this but i quic