OutputDataPort

Hi, i am using spine-cocos2d-objc in my project. My assets are located at server, so i have to download it first. I placed my asset in sandbox folder like file:///Users/nihua/Library/Developer/CoreSimulator/Devices/A8CCF944-2559-4853-A6AC-FC009BE33D86/data/Containers/Data/Application/D78A7701-27A0-4568-ACEA-D46A00A0FE16/Documents/characterAsset.json

After the download is complete, and the asset already in there, I fail to load it with
skeletonNode = [SkeletonAnimation skeletonWithFile:"characterAsset.json" atlasFile:"characterAsset.json" scale:0.7];
But, I get this error instead
2019-08-07 10:26:03.810378+0700 OwlPlast[64861:2753161] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Error reading atlas file: characterAsset.json'

So my question is, could spine load skeleton and atlas file with the URL in my sandbox app? Thank you.
OutputDataPort
  • Сообщения: 10

badlogic

Spine uses cocos2d's file loading APIs:

spine-runtimes/spine-cocos2d-objc.m at 3.8

I would assume the file:/// prefix might be the culprit.
Аватара пользователя
badlogic

Mario
  • Сообщения: 2108

wade0595

@badlogic
hello,
Can you say it clearly? I don't understand it because we have the same problem. I don't know how to load the downloaded json, atlas, png files, please let us know, thank you

---

badlogic писал(а):Spine uses cocos2d's file loading APIs:

https://github.com/EsotericSoftware/spine-runtimes/blob/3.8/spine-cocos2d-objc/src/spine/spine-cocos2d-objc.m

I would assume the file:/// prefix might be the culprit.
@badlogic
hello,
Can you say it clearly? I don't understand it because we have the same problem. I don't know how to load the downloaded json, atlas, png files, please let us know, thank you
wade0595
  • Сообщения: 2

badlogic

We use the file loading of cocos2d-x. When you specify a path for a file to load, it needs to follow the requirements of cocos2d-x. Please ask on the cocos2d-x forums how this can be achieved through their API.
Аватара пользователя
badlogic

Mario
  • Сообщения: 2108

wade0595

我们原先把文件存到 NSLibraryDirectory 导致读取不到,现在把文件存到 Documents 目录下就可以了
wade0595
  • Сообщения: 2


Вернуться в Runtimes