- Изменено
cocos2d-x SkeletonAnimation crash
cocos2d-x: v4
spine-runtimes: v3.8
error message:
A/libc: spine-runtimes/spine-cpp/spine-cpp/src/spine/Skin.cpp:96: spine::Skin::Skin(const spine::String &): assertion "_name.length() > 0" failed
here is my code :
auto loading = SkeletonAnimation::createWithJsonFile("HD/Spine/misc/loading.json", "HD/Spine/misc/loading.atlas",0.6f);
loading->setPosition(cocos2d::Vec2(origin.x + visibleSize.width / 2, origin.y + visibleSize.height / 2));
loading->setAnimation(0, "loading", true);
addChild(loading);
when i try the same code with different files, its fine, i try it with goblin.json and goblin.atlas from
https://github.com/EsotericSoftware/spine-runtimes/tree/3.8/spine-cocos2dx/example/Resources/common
i don't know what is the cause of the problem, please help me to find solution this problem.
maybe there is a problem with my json or atlas file, i uploaded my file json, atlas, and image.
You are trying to load a Spine project exported with Spine Editor version 2.1.27 with Spine Runtimes version 3.8. I'm afraid that won't work. Please update your Spine project to Spine Editor version 3.8.x and re-export it.
Thanks for the answer, but can I import and re-export with my current json and atlas files?
I mean, I forgot where my previous spine project was and only had the export results
You'll need to run 2.1.27, import your skeleton data files with Import Data, save a Spine project file, then you can open that with 3.8. Ideally you keep your Spine project files so this isn't needed. You can do it from the command line if you have many files.
You can use your existing atlas files with the 3.8 exported data. Or you can use Spine's texture unpacker to turn the atlas files into individual image files. You'll need to do that if you want to see images in the Spine editor or to repack the atlases with more or different images.