Hi all,
I try to load tmx file on android, but aways load failed with “Get data from file(asserts/level1.tmx) failed!”.
I try some method which found in this forum, but load failed also.
please help me to solve it. Thank you very much…
Hi all,
I try to load tmx file on android, but aways load failed with “Get data from file(asserts/level1.tmx) failed!”.
I try some method which found in this forum, but load failed also.
please help me to solve it. Thank you very much…
I built ti on 2.0.3 and 2.0.4, it didn’t work too.
please help me. thanks.
Could you paste the codes?
What’s the path of the tmx file?
Thanks for your feedback.
I put all files in Resources folder, but i try to put all files in Resources\sub it didn’t work also.
Blow is code:
CCTMXTiledMap* map = CCTMXTiledMap::create(“level1.tmx”);
when i put all files to sub folder, i change code to :
CCTMXTiledMap* map = CCTMXTiledMap::create(“sub/level1.tmx”);
One more information:
when i put all files to sub folder, one png file load failed with “Get data from file(asserts/sub/Default.png) failed!”.
Sorry i forgot one thing:
I built the sample “TestCpp” for android, it work fine.
I didn’t find any different code from “TestCpp”, because i follow the sample to do this.
i added some log in cocos2d-2.0-x-2.0.4\cocos2dx\platform\android\CCFileUtils.cpp, CCFileUtils::getFileData
parameter “pszFileName” is normal.
so i guess it is get null pointer int “pData = CCFileUtils::getFileDataFromZip(…)”.
Due to i haven’t environment now, so i could not continue to do this….
It is working now. It is my mistake for giving a wrong file name(file name is low case…), when i change the file name to “Level1.tmx”, it work fine…….