setAttachment method

void setAttachment(
  1. int slotIndex,
  2. String name,
  3. Attachment<Pointer<NativeType>>? attachment
)

Adds an attachment to the skin for the specified slot index and name.

Implementation

void setAttachment(int slotIndex, String name, Attachment? attachment) {
  final nativeName = name.toNativeUtf8(allocator: _allocator);
  _bindings.spine_skin_set_attachment(_skin, slotIndex, nativeName.cast(), attachment == null ? nullptr : attachment._attachment.cast());
  _allocator.free(nativeName);
}