setSkinByName method

void setSkinByName(
  1. String skinName
)

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 See Skeleton::setSlotsToSetupPose() Also, often AnimationState::apply(Skeleton&) 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. @param skinName May be NULL.

Implementation

void setSkinByName(String skinName) {
  final nameNative = skinName.toNativeUtf8(allocator: _allocator);
  _bindings.spine_skeleton_set_skin_by_name(_skeleton, nameNative.cast());
  _allocator.free(nameNative);
}