EsotericSoftware / spine-runtimes

2D skeletal animation runtimes for Spine.
http://esotericsoftware.com/
Other
4.4k stars 2.91k forks source link

[runtimes] Ensure all language runtimes have up-to-date code documentation #1506

Open jonchun opened 5 years ago

jonchun commented 5 years ago






Depending on the version of the runtime, it looks like some of the API has changed with very similar functionality but some slight differences. I don't understand enough about how Attachments, Skins, Bones, etc interact to immediately know what the differences are. Before I dive into some research, I thought I'd make an issue here to see if there's already documentation in place for this type of thing, or if it might be worth putting some notes in place for people in my situation going forward in the future.

Here is the only source of API docs I could find, with no obvious way to reference historical versions: http://esotericsoftware.com/spine-runtime-skins

Specifically, I'm having trouble with the Skins API. It has changed a bit from 3.7 to 3.8 to 3.9.

In this case, using the spine-ts runtime, I can't tell what the differences between Skin.addSkin() and Skin.copySkin() are doing. Both methods seem to work for interchangeably for me when I do something like

// findSkin is a wrapper for _spineGO.skeletonData.findSkin(skinName);
const skin: Skin = this._spineGO.findSkin("body_001");
const face: Skin = this._spineGO.findSkin("face_001");
const top: Skin = this._spineGO.findSkin("top_002");
const bottom: Skin = this._spineGO.findSkin("bottom_001");
const weapon: Skin = this._spineGO.findSkin("weapon_001");

skin.copySkin(face);
skin.addSkin(top);
skin.copySkin(bottom);
skin.copySkin(weapon);

// blah blah
// setSkin(skin)
badlogic commented 5 years ago

Sorry for the confusion. API changes like that, especially if they are breaking changes, are always discussed in the CHANGELOG in the root folder of the repository. In addition, we also discuss them in the release blog posts of the respective version.

The code side documentation is definitely lacking here though. Sorry for that! I've adjusted your initial issue comment to include tasks for updating the API docs for all language runtimes. When in doubt, you can always look into the reference implementation API docs (spine-libgdx)