Skip to main content

Spine

Description:

  An implementation of an animation system using the Spine engine.

Class Object: Spine Class.

Inherits from: Playable.

hitTestEnabled

Type: Field.

Description:

  Whether hit testing is enabled.

Signature:

hitTestEnabled: boolean

setBoneRotation

Type: Function.

Description:

  Sets the rotation of a bone in the Spine skeleton.

Signature:

setBoneRotation: function(self: Spine, name: string, rotation: number): boolean

Parameters:

ParameterTypeDescription
namestringThe name of the bone to rotate.
rotationnumberThe amount to rotate the bone, in degrees.

Returns:

Return TypeDescription
booleanWhether the rotation was successfully set or not.

containsPoint

Type: Function.

Description:

  Checks if a point in space is inside the boundaries of the Spine skeleton.

Signature:

containsPoint: function(self: Spine, x: number, y: number): string | nil

Parameters:

ParameterTypeDescription
xnumberThe x-coordinate of the point to check.
ynumberThe y-coordinate of the point to check.

Returns:

Return TypeDescription
string|nilThe name of the bone at the point, or nil if there is no bone at the point.

intersectsSegment

Type: Function.

Description:

  Checks if a line segment intersects the boundaries of the instance and returns the name of the bone or slot at the intersection point, or nil if no bone or slot is found.

Signature:

intersectsSegment: function(self: Spine, x1: number, y1: number, x2: number, y2: number): string | nil

Parameters:

ParameterTypeDescription
x1numberThe x-coordinate of the start point of the line segment.
y1numberThe y-coordinate of the start point of the line segment.
x2numberThe x-coordinate of the end point of the line segment.
y2numberThe y-coordinate of the end point of the line segment.

Returns:

Return TypeDescription
string|nilThe name of the bone or slot at the intersection point, or nil if no bone or slot is found.