Hi people .
i;m loading chimpmunk shapes and bodys from a plist ( xml ) generated by PhisicEditor. I using cocos2d-x v3.10 both
i preload as usual the resource to use with the
var gameResources = [
"assets/3x1.png",
"assets/3x2.png",
"assets/3x3.png",
"assets/ball.png",
"assets/chimpmunk.plist",
];
and
cc.LoaderScene.preload(gameResources, function () { ....
...
}
in the PhisicEdit Loader i found GCpShapeCache.js basically generate a dictionary with the resource file , and use it to apply shapes and bodys properties, originaly it load the resource file using…
var dict cc.FileUtils.getInstance().createDictionaryWithContentsOfFile(plist);
but Fileutils seems to be deprecated in v3.x so i change it to
var dict = cc.loader.get( "assets/chimpmunk.plist" );
the code It works fine in cocos2d-html5 ( i mean running in the browser ) but when i try to run the code in the simulator the resource “assets/chimpmunk.plist” not found.* dict = undefined
The other resources “assets/3x1.png”, “assets/3x2.png” used to create sprites work perfect.in both platform
The laoder also propose to load the resourse,
var dict ;
cc.loader.loadTxt(plist, function (err, txt) {
try{
if (!err) {
var dict = cc.plistParser.parse(txt);
this.processData(dictionary);
}
}catch(e){
throw e;
}
}.bind(this));
but also fails… Do anyone have an idea why the pList is unable to be loaded with cc.loader.getRes do not work for xml plist file? is there any other way to load this resource?
Other error i found… is that i compile the android simulator with
cocos gen-simulator -p android… but when i install it in my phone , the app crash.
As anyone being able to copile and install the cocos2d-x v3.10 simulator in your phone ( android 4.4 )???
Thanks for your help