Home > other >  Cocos2d - read x3.10 Tiled map piece of it to memory error ~ how to return a responsibility?
Cocos2d - read x3.10 Tiled map piece of it to memory error ~ how to return a responsibility?

Time:09-21



I don't add the map inside the Tiled, empty can run normally,


If add any format of the figure image, and then run will quote memory errors,


Is stock photography or the cause of the path, I tried, all also replaced multiple versions of a Tiled will appear problem,

With open notepad TMX file didn't also found the problem,

Were tried 1 x1, behind the map size tiles is 32 x32 pixels pixel

PNG or JPG images is 32 x32 pixels, just add a figure he error,


 
Bool HelloWorld: : init ()
{
if (! Layer: : init ())
{
return false;
}

STD: : string file="s.t mx";
Auto STR=String: : createWithContentsOfFile (FileUtils: : getInstance () - & gt; FullPathForFilename (file. C_str ()). C_str ());
_tileMap=TMXTiledMap: : createWithXML (STR - & gt; GetCString (), "");
_background=_tileMap - & gt; LayerNamed (" Background ");

AddChild (_tileMap, 1);

return true;
}

CodePudding user response:

The building Lord solved not, me too
  • Related