I’m looking to use spine binary (.skel) files for the spine animation in a game. According to the Cocos Creator docs, .skel files are supported, but I can’t figure out how to use them. Does the sp.Skeleton component not know how to use these or is there a different flow for importing them? I can’t seem to find much info on this problem elsewhere. (I’m using Cocos Creator v2.4 and Spine v3.8)
I’m not sure why you want to use binary format for Spine animations. It will be better if you just export a
.json and use that instead. What advantage does binary format provide that you don’t get in the JSON format?
I checked the source code of
sp.Skeleton component, and it does not seem to support the binary format. They probably mean you can use an extension of
.skel for your skeleton, but it has to have JSON content inside of it anyway.
.skel is binary format (
.skel.bytes is the full format type). It is smaller and considerably faster to read, so preferable to
.json for optimization.
According to the cocos docs,
.skel files are supported, but it appears you have to write your own importer to actually use them. Out of the box, cocos only appears to have an import flow for creating the SkeletonData asset from a
.json and not the
.json is pretty fast too on devices. I understand that binary would be faster, but there’s not much perceivable performance gain you’re going to see. As for smaller, if you export the JSON in compressed format, it will be small too. In the actual APK, the size difference would be a few KB and it wouldn’t matter much.
As an example, in my game I import about 30 Spine animations, and there’s no performance issues whatsoever. However I do have a preloader screen where I show a loading symbol while the scene is being loaded.