setSkin method

void setSkin(
  1. Skin skin
)

Sets the skin used to look up attachments before looking in the default skin (see SkeletonData.getDefaultSkin). If the skin is changed, updateCache is called.

Attachments from the new skin are attached if the corresponding attachment from the old skin was attached. If there was no old skin, each slot's setup mode attachment is attached from the new skin.

After changing the skin, the visible attachments can be reset to those attached in the setup pose by calling setSlotsToSetupPose. Also, often AnimationState.apply is called before the next time the skeleton is rendered to allow any attachment keys in the current animation(s) to hide or show attachments from the new skin.

Implementation

void setSkin(Skin skin) {
  _bindings.spine_skeleton_set_skin(_skeleton, skin._skin);
}