您无法使用Spine Runtimes 3.8版加载从Spine Editor 3.5版导出的框架。 编辑器的版本和运行时必须匹配。 您可以在Spine Editor 3.8中加载在Spine Editor 3.5中创建的Spine项目,并将其升级到该版本。 然后将其重新导出为Spine Runtimes 3.8。
我看过您的示例,文件夹“ spine-3.5”和“ spine-3.8”中的源代码都有很多错误。 您似乎已经将代码基于spritesheets演示了,这非常复杂。 我为您创建了一个简单的示例:
spine-runtimes/test-simple.html at 3.8
它使用二进制.skel格式而不是.json格式,但是经过细微调整,您也可以将其与.json格式一起使用。 您将必须将项目更新为3.5。
另外,您还可以研究pixiJS和pixi-spine,它们可能比WebGL后端更易于使用。 看到
https://github.com/pixijs/pixi-spine
You can not load a skeleton exported from Spine Editor version 3.5 with the Spine Runtimes version 3.8. The versions of the editor and the runtimes must match. You can load your Spine project created in Spine Editor 3.5 in Spine Editor 3.8 and upgrade it to that version. Then re-export it for Spine Runtimes 3.8.
I have looked at your example, and both the source code in the folder spine-3.5
and spine-3.8
have lots of errors in them. You seem to have based your code on the spritesheets demo, which is very complex. I have created a simple example for you:
spine-runtimes/test-simple.html at 3.8
It uses the binary .skel
format instead of .json
, but with minor adjustments you can also use it with .json
. You will have to update your project to 3.5.
Alternatively, you can also look into pixiJS and pixi-spine, which might be easier to use than our WebGL backend. See
https://github.com/pixijs/pixi-spine