Skeleton class
Stores bones and slots to be posed by animations and application code. Multiple skeleton instances can share the same SkeletonData, including animations, attachments, and skins.
After posing, call updateWorldTransform(Physics) to apply constraints and compute world transforms for rendering.
- Available extensions
Constructors
- Skeleton(SkeletonData skeletonData)
-
factory
-
Skeleton.fromPointer(Pointer<
spine_skeleton_wrapper> _ptr)
Properties
- bones → ArrayBone
-
no setter
- bounds → Bounds
-
Available on Skeleton, provided by the SkeletonExtensions extension
Get the axis-aligned bounding box (AABB) containing all world vertices of the skeletonno setter - color → Color
-
no setter
- constraints → ArrayConstraint
-
no setter
- data → SkeletonData
-
no setter
- drawOrder → DrawOrder
-
The skeleton's draw order. Use DrawOrder::getAppliedPose() for rendering
and DrawOrder::getPose() for changing the draw order.
no setter
- gravityX ↔ double
-
The x component of a vector that defines the direction
PhysicsConstraintPose::getGravity() is applied.
getter/setter pair
- gravityY ↔ double
-
The y component of a vector that defines the direction
PhysicsConstraintPose::getGravity() is applied.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
-
nativePtr
→ Pointer<
NativeType> -
Get the native pointer for FFI calls
no setter
- physicsConstraints → ArrayPhysicsConstraint
-
The skeleton's physics constraints.
no setter
- rootBone → Bone?
-
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scaleX ↔ double
-
getter/setter pair
- scaleY ↔ double
-
getter/setter pair
- setColor ← Color
-
no getter
- skin → Skin?
-
no setter
- slots → ArraySlot
-
The skeleton's slots in setup pose order. To change the order use
DrawOrder::getPose(). For rendering use DrawOrder::getAppliedPose().
no setter
- time ↔ double
-
Returns the skeleton's time, used for time-based manipulations, such as
PhysicsConstraint.
getter/setter pair
- updateCacheList → ArrayUpdate
-
no setter
- windX ↔ double
-
The x component of a vector that defines the direction
PhysicsConstraintPose::getWind() is applied.
getter/setter pair
- windY ↔ double
-
The y component of a vector that defines the direction
PhysicsConstraintPose::getWind() is applied.
getter/setter pair
- x ↔ double
-
getter/setter pair
- y ↔ double
-
getter/setter pair
Methods
-
constrained(
Posed object) → void -
dispose(
) → void -
findBone(
String boneName) → Bone? - Returns May be NULL.
-
findSlot(
String slotName) → Slot? - Returns May be NULL.
-
getAttachment(
String slotName, String placeholder) → Attachment? - Finds an attachment by looking in getSkin() and SkeletonData::getDefaultSkin() using the slot name and skin placeholder name. First the skin is checked and if the attachment was not found, the default skin is checked.
-
getAttachment2(
int slotIndex, String placeholder) → Attachment? - Finds an attachment by looking in getSkin() and SkeletonData::getDefaultSkin() using the slot index and skin placeholder name. First the skin is checked and if the attachment was not found, the default skin is checked.
-
getPosition(
) → Vector -
Available on Skeleton, provided by the SkeletonExtensions extension
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
physicsRotate(
double x, double y, double degrees) → void - Calls {
-
physicsTranslate(
double x, double y) → void - Rotates the physics constraint so next {
-
printUpdateCache(
) → void -
setAttachment(
String slotName, String placeholder) → void - A convenience method to set an attachment by finding the slot with findSlot(String), finding the attachment with getAttachment(int, String), then setting the slot's SlotPose::getAttachment().
-
setColor2(
double r, double g, double b, double a) → void -
setPosition(
double x, double y) → void -
setScale(
double scaleX, double scaleY) → void -
setSkin(
String skinName) → void - Sets a skin by name (see setSkin).
-
setSkin2(
Skin? newSkin) → void - Sets the skin used to look up attachments before looking in SkeletonData::getDefaultSkin(). If the skin is changed, updateCache() is called.
-
setupPose(
) → void - Sets the bones, constraints, and slots to their setup pose values.
-
setupPoseBones(
) → void - Sets the bones and constraints to their setup pose values.
-
setupPoseSlots(
) → void -
sortBone(
Bone? bone) → void -
toString(
) → String -
A string representation of this object.
inherited
-
update(
double delta) → void -
updateCache(
) → void - Caches information about bones and constraints. Must be called if the active skin is modified or if bones, constraints, or weighted path attachments are added or removed.
-
updateWorldTransform(
Physics physics) → void - Updates the world transform for each bone and applies all constraints.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited