Friday, 29 July 2011

Just beware of...

..your textures not being included in your tmxtiledmap whenever you are using cocos2d. I was using the java and it had the option to included all tilesets in the tmx file, however this does not work and you need to have the .png of your tileset in the xcode resources with the map itself. 

Also, if your tileset files weren't part of the same root folder as the map when you were making it, it won't know where to look for the right file. To correct this, whenever you import the tmx map into xcode resources, click on it and it should show xml code and edit the 4th line to read;

  <image source="yourspritesheet" width="NUMBER" height="NUMBER"/>.  

You would get the error:
exec_arithmetic error on rect.origin.x = (gid % max_x) * (tileSize_.width + spacing_) + margin_;

No comments:

Post a Comment