From a4869075204ba9d1e420116bc1d95217522ab29b Mon Sep 17 00:00:00 2001 From: Davide Tantillo Date: Thu, 26 Mar 2026 12:35:42 +0100 Subject: [PATCH] [ts] Fixed TSdoc. --- spine-ts/spine-core/src/Animation.ts | 151 +++++++-------- spine-ts/spine-core/src/AnimationState.ts | 172 +++++++++--------- spine-ts/spine-core/src/AnimationStateData.ts | 7 +- .../spine-core/src/AtlasAttachmentLoader.ts | 6 +- spine-ts/spine-core/src/Bone.ts | 15 +- spine-ts/spine-core/src/BonePose.ts | 38 ++-- spine-ts/spine-core/src/DrawOrder.ts | 4 +- spine-ts/spine-core/src/Event.ts | 6 +- spine-ts/spine-core/src/EventData.ts | 3 +- spine-ts/spine-core/src/IkConstraintData.ts | 2 +- spine-ts/spine-core/src/IkConstraintPose.ts | 4 +- spine-ts/spine-core/src/Physics.ts | 3 +- spine-ts/spine-core/src/PhysicsConstraint.ts | 6 +- .../spine-core/src/PhysicsConstraintData.ts | 2 +- .../spine-core/src/PhysicsConstraintPose.ts | 5 +- spine-ts/spine-core/src/Posed.ts | 12 +- spine-ts/spine-core/src/PosedActive.ts | 7 +- spine-ts/spine-core/src/PosedData.ts | 8 +- spine-ts/spine-core/src/Skeleton.ts | 52 +++--- spine-ts/spine-core/src/SkeletonBounds.ts | 4 +- spine-ts/spine-core/src/SkeletonData.ts | 7 +- spine-ts/spine-core/src/Skin.ts | 9 +- spine-ts/spine-core/src/Slider.ts | 6 +- spine-ts/spine-core/src/SliderData.ts | 8 +- spine-ts/spine-core/src/SliderPose.ts | 3 +- spine-ts/spine-core/src/Slot.ts | 4 +- spine-ts/spine-core/src/SlotData.ts | 1 + spine-ts/spine-core/src/SlotPose.ts | 11 +- .../spine-core/src/TransformConstraintData.ts | 6 +- spine-ts/spine-core/src/Update.ts | 2 +- .../spine-core/src/attachments/Attachment.ts | 21 ++- .../src/attachments/BoundingBoxAttachment.ts | 1 + .../spine-core/src/attachments/HasSequence.ts | 5 +- .../src/attachments/MeshAttachment.ts | 12 +- .../src/attachments/PathAttachment.ts | 1 + .../src/attachments/RegionAttachment.ts | 10 +- .../spine-core/src/attachments/Sequence.ts | 20 +- 37 files changed, 328 insertions(+), 306 deletions(-) diff --git a/spine-ts/spine-core/src/Animation.ts b/spine-ts/spine-core/src/Animation.ts index 77e0392d2..a7e4fbf95 100644 --- a/spine-ts/spine-core/src/Animation.ts +++ b/spine-ts/spine-core/src/Animation.ts @@ -30,19 +30,26 @@ import { type Attachment, VertexAttachment } from "./attachments/Attachment.js"; import { type HasSequence, isHasSequence } from "./attachments/HasSequence.js"; import { SequenceMode, SequenceModeValues } from "./attachments/Sequence.js"; +import type { Bone } from "./Bone.js"; import type { Inherit } from "./BoneData.js"; import type { BonePose } from "./BonePose.js"; import type { Event } from "./Event.js"; import type { IkConstraint } from "./IkConstraint.js"; +import type { IkConstraintPose } from "./IkConstraintPose.js"; import type { PathConstraint } from "./PathConstraint.js"; +import type { PathConstraintPose } from "./PathConstraintPose.js"; import type { PhysicsConstraint } from "./PhysicsConstraint.js"; import type { PhysicsConstraintData } from "./PhysicsConstraintData.js"; import type { PhysicsConstraintPose } from "./PhysicsConstraintPose.js"; +import type { Posed } from "./Posed.js"; import type { Skeleton } from "./Skeleton.js"; +import type { SkeletonData } from "./SkeletonData.js"; import type { Slider } from "./Slider.js"; +import type { SliderPose } from "./SliderPose.js"; import type { Slot } from "./Slot.js"; import type { SlotPose } from "./SlotPose.js"; import type { TransformConstraint } from "./TransformConstraint.js"; +import type { TransformConstraintPose } from "./TransformConstraintPose.js"; import { type NumberArrayLike, StringSet, Utils } from "./Utils.js"; /** Stores a list of timelines to animate a skeleton's pose over time. @@ -52,7 +59,7 @@ import { type NumberArrayLike, StringSet, Utils } from "./Utils.js"; export class Animation { /** The animation's name, unique across all animations in the skeleton. * - * See {@link SkeletonData#findAnimation(String)}. */ + * See {@link SkeletonData.findAnimation}. */ readonly name: string; /** The duration of the animation in seconds, which is usually the highest time of all frames in the timelines. The duration is @@ -61,9 +68,9 @@ export class Animation { readonly timelineIds: StringSet; - /** {@link Skeleton#getBones()} indices that this animation's timelines modify. + /** {@link Skeleton.getBones} indices that this animation's timelines modify. * - * See {@link BoneTimeline#bones}. */ + * See {@link BoneTimeline.bones}. */ readonly bones: Array; /** The duration of the animation in seconds, which is usually the highest time of all frames in the timeline. The duration is @@ -98,7 +105,7 @@ export class Animation { /** Returns true if this animation contains a timeline with any of the specified property IDs. * - * See {@link Timeline#propertyIds()}. */ + * See {@link Timeline.propertyIds}. */ hasTimeline (ids: string[]): boolean { for (let i = 0; i < ids.length; i++) if (this.timelineIds.contains(ids[i])) return true; @@ -106,30 +113,30 @@ export class Animation { } /** Applies the animation's timelines to the specified skeleton. - *

- * See {@link Timeline#apply(Skeleton, float, float, Array, float, boolean, boolean, boolean, boolean)} and + * + * See {@link Timeline.apply} and * Applying Animations in the Spine Runtimes * Guide. * @param skeleton The skeleton the animation is applied to. This provides access to the bones, slots, and other skeleton * components the timelines may change. * @param lastTime The last time in seconds this animation was applied. Some timelines trigger only at discrete times, in which - * case all keys are triggered between lastTime (exclusive) and time (inclusive). Pass -1 + * case all keys are triggered between `lastTime` (exclusive) and `time` (inclusive). Pass -1 * the first time an animation is applied to ensure frame 0 is triggered. * @param time The time in seconds the skeleton is being posed for. Timelines find the frame before and after this time and * interpolate between the frame values. - * @param loop True if time beyond the {@link #duration} repeats the animation, else the last frame is used. + * @param loop True if `time` beyond the {@link duration} repeats the animation, else the last frame is used. * @param events If any events are fired, they are added to this list. Pass null to ignore fired events or if no timelines fire * events. - * @param alpha 0 applies setup or current values (depending on fromSetup), 1 uses timeline values, and - * intermediate values interpolate between them. Adjusting alpha over time can mix an animation in or + * @param alpha 0 applies setup or current values (depending on `fromSetup`), 1 uses timeline values, and + * intermediate values interpolate between them. Adjusting `alpha` over time can mix an animation in or * out. - * @param fromSetup If true, alpha transitions between setup and timeline values, setup values are used before the - * first frame (current values are not used). If false, alpha transitions between current and timeline + * @param fromSetup If true, `alpha` transitions between setup and timeline values, setup values are used before the + * first frame (current values are not used). If false, `alpha` transitions between current and timeline * values, no change is made before the first frame. * @param add If true, for timelines that support it, their values are added to the setup or current values (depending on - * fromSetup). + * `fromSetup`). * @param out True when the animation is mixing out, else it is mixing in. Used by timelines that perform instant transitions. - * @param appliedPose True to modify {@link Posed#appliedPose}, else {@link Posed#pose} is modified. */ + * @param appliedPose True to modify {@link Posed.appliedPose}, else {@link Posed.pose} is modified. */ apply (skeleton: Skeleton, lastTime: number, time: number, loop: boolean, events: Array | null, alpha: number, fromSetup: boolean, add: boolean, out: boolean, appliedPose: boolean) { if (!skeleton) throw new Error("skeleton cannot be null."); @@ -181,7 +188,7 @@ export enum Property { } /** The base class for all timelines. - *

+ * * See Applying Animations in the Spine * Runtimes Guide. */ export abstract class Timeline { @@ -219,35 +226,35 @@ export abstract class Timeline { } /** Applies this timeline to the skeleton. - *

+ * * See Applying Animations in the Spine * Runtimes Guide. * @param skeleton The skeleton the timeline is applied to. This provides access to the bones, slots, and other skeleton * components the timelines may change. * @param lastTime The last time in seconds this timeline was applied. Some timelines trigger only at discrete times, in - * which case all keys are triggered between lastTime (exclusive) and time (inclusive). + * which case all keys are triggered between `lastTime` (exclusive) and `time` (inclusive). * Pass -1 the first time a timeline is applied to ensure frame 0 is triggered. * @param time The time in seconds the skeleton is being posed for. Timelines find the frame before and after this time and * interpolate between the frame values. * @param events If any events are fired, they are added to this list. Pass null to ignore fired events or if no timelines * fire events. - * @param alpha 0 applies setup or current values (depending on fromSetup), 1 uses timeline values, and - * intermediate values interpolate between them. Adjusting alpha over time can mix a timeline in or + * @param alpha 0 applies setup or current values (depending on `fromSetup`), 1 uses timeline values, and + * intermediate values interpolate between them. Adjusting `alpha` over time can mix a timeline in or * out. - * @param fromSetup If true, alpha transitions between setup and timeline values, setup values are used before - * the first frame (current values are not used). If false, alpha transitions between current and + * @param fromSetup If true, `alpha` transitions between setup and timeline values, setup values are used before + * the first frame (current values are not used). If false, `alpha` transitions between current and * timeline values, no change is made before the first frame. * @param add If true, for timelines that support it, their values are added to the setup or current values (depending on - * fromSetup). + * `fromSetup`). * @param out True when the animation is mixing out, else it is mixing in. Used by timelines that perform instant * transitions. - * @param appliedPose True to modify {@link Posed#appliedPose}, else {@link Posed#pose} is modified. */ + * @param appliedPose True to modify {@link Posed.appliedPose}, else {@link Posed.pose} is modified. */ abstract apply (skeleton: Skeleton, lastTime: number, time: number, events: Array | null, alpha: number, fromSetup: boolean, add: boolean, out: boolean, appliedPose: boolean): void; /** Linear search using the specified stride (default 1). - * @param time Must be >= the first value in frames. - * @return The index of the first value <= time. */ + * @param time Must be >= the first value in `frames`. + * @return The index of the first value <= `time`. */ static search (frames: NumberArrayLike, time: number, step = 1) { const n = frames.length; for (let i = step; i < n; i += step) @@ -286,7 +293,7 @@ export abstract class CurveTimeline extends Timeline { this.curves[frame] = 1/*STEPPED*/; } - /** Shrinks the storage for Bezier curves, for use when bezierCount (specified in the constructor) was larger + /** Shrinks the storage for Bezier curves, for use when `bezierCount` (specified in the constructor) was larger * than the actual number of Bezier curves. */ shrink (bezierCount: number) { const size = this.getFrameCount() + bezierCount * 18/*BEZIER_SIZE*/; @@ -299,9 +306,9 @@ export abstract class CurveTimeline extends Timeline { /** Stores the segments for the specified Bezier curve. For timelines that modify multiple values, there may be more than * one curve per frame. - * @param bezier The ordinal of this Bezier curve for this timeline, between 0 and bezierCount - 1 (specified + * @param bezier The ordinal of this Bezier curve for this timeline, between 0 and `bezierCount - 1` (specified * in the constructor), inclusive. - * @param frame Between 0 and frameCount - 1, inclusive. + * @param frame Between 0 and `frameCount - 1`, inclusive. * @param value The index of the value for this frame that this curve is used for. * @param time1 The time for the first key. * @param value1 The value for the first key. @@ -334,9 +341,9 @@ export abstract class CurveTimeline extends Timeline { } /** Returns the Bezier interpolated value for the specified time. - * @param frameIndex The index into {@link #frames} for the values of the frame before time. - * @param valueOffset The offset from frameIndex to the value this curve is used for. - * @param i The index of the Bezier segments. See {@link #getCurveType(int)}. */ + * @param frameIndex The index into {@link frames} for the values of the frame before `time`. + * @param valueOffset The offset from `frameIndex` to the value this curve is used for. + * @param i The index of the Bezier segments. See {@link getCurveType}. */ getBezierValue (time: number, frameIndex: number, valueOffset: number, i: number) { const curves = this.curves; if (curves[i] > time) { @@ -367,7 +374,7 @@ export abstract class CurveTimeline1 extends CurveTimeline { } /** Sets the time and value for the specified frame. - * @param frame Between 0 and frameCount, inclusive. + * @param frame Between 0 and `frameCount`, inclusive. * @param time The frame time in seconds. */ setFrame (frame: number, time: number, value: number) { frame <<= 1; @@ -400,8 +407,8 @@ export abstract class CurveTimeline1 extends CurveTimeline { /** Returns the interpolated value for properties relative to the setup value. The timeline value is added to the setup * value, rather than replacing it. - *

- * See {@link Timeline#apply(Skeleton, float, float, Array, float, boolean, boolean, boolean, boolean)}. + * + * See {@link Timeline.apply}. * @param current The current value for the property. * @param setup The setup value for the property. */ getRelativeValue (time: number, alpha: number, fromSetup: boolean, add: boolean, current: number, setup: number) { @@ -412,16 +419,16 @@ export abstract class CurveTimeline1 extends CurveTimeline { /** Returns the interpolated value for properties set as absolute values. The timeline value replaces the setup value, * rather than being relative to it. - *

- * See {@link Timeline#apply(Skeleton, float, float, Array, float, boolean, boolean, boolean, boolean)}. + * + * See {@link Timeline.apply}. * @param current The current value for the property. * @param setup The setup value for the property. */ getAbsoluteValue (time: number, alpha: number, fromSetup: boolean, add: boolean, current: number, setup: number): number; /** Returns the interpolated value for properties set as absolute values, using the specified timeline value rather than - * calling {@link #getCurveValue(float)}. - *

- * See {@link Timeline#apply(Skeleton, float, float, Array, float, boolean, boolean, boolean, boolean)}. + * calling {@link getCurveValue}. + * + * See {@link Timeline.apply}. * @param current The current value for the property. * @param setup The setup value for the property. * @param value The timeline value to apply. */ @@ -447,7 +454,7 @@ export abstract class CurveTimeline1 extends CurveTimeline { /** Returns the interpolated value for scale properties. The timeline and setup values are multiplied and sign adjusted. * - * See {@link Timeline#apply(Skeleton, float, float, Array, float, boolean, boolean, boolean, boolean)}. + * See {@link Timeline.apply}. * @param current The current value for the property. * @param setup The setup value for the property. */ getScaleValue (time: number, alpha: number, fromSetup: boolean, add: boolean, out: boolean, current: number, setup: number) { @@ -497,7 +504,7 @@ export abstract class BoneTimeline1 extends CurveTimeline1 implements BoneTimeli export abstract class BoneTimeline2 extends CurveTimeline implements BoneTimeline { readonly boneIndex; - /** @param bezierCount The maximum number of Bezier curves. See {@link #shrink(int)}. + /** @param bezierCount The maximum number of Bezier curves. See {@link shrink}. * @param propertyIds Unique identifiers for the properties the timeline modifies. */ constructor (frameCount: number, bezierCount: number, boneIndex: number, property1: Property, property2: Property) { super(frameCount, bezierCount, `${property1}|${boneIndex}`, `${property2}|${boneIndex}`); @@ -510,7 +517,7 @@ export abstract class BoneTimeline2 extends CurveTimeline implements BoneTimelin } /** Sets the time and values for the specified frame. - * @param frame Between 0 and frameCount, inclusive. + * @param frame Between 0 and `frameCount`, inclusive. * @param time The frame time in seconds. */ setFrame (frame: number, time: number, value1: number, value2: number) { frame *= 3/*ENTRIES*/; @@ -530,7 +537,7 @@ export abstract class BoneTimeline2 extends CurveTimeline implements BoneTimelin out: boolean,): void; } -/** Changes {@link BonePose#rotation}. */ +/** Changes {@link BonePose.rotation}. */ export class RotateTimeline extends BoneTimeline1 { constructor (frameCount: number, bezierCount: number, boneIndex: number) { super(frameCount, bezierCount, boneIndex, Property.rotate); @@ -711,7 +718,7 @@ export class ScaleYTimeline extends BoneTimeline1 { } } -/** Changes {@link Bone#shearX} and {@link Bone#shearY}. */ +/** Changes {@link Bone.shearX} and {@link Bone.shearY}. */ export class ShearTimeline extends BoneTimeline2 { constructor (frameCount: number, bezierCount: number, boneIndex: number) { super(frameCount, bezierCount, boneIndex, Property.shearX, Property.shearY); @@ -762,7 +769,7 @@ export class ShearTimeline extends BoneTimeline2 { } } -/** Changes {@link Bone#shearX} and {@link Bone#shearY}. */ +/** Changes {@link Bone.shearX} and {@link Bone.shearY}. */ export class ShearXTimeline extends BoneTimeline1 { constructor (frameCount: number, bezierCount: number, boneIndex: number) { super(frameCount, bezierCount, boneIndex, Property.shearX); @@ -774,7 +781,7 @@ export class ShearXTimeline extends BoneTimeline1 { } } -/** Changes {@link Bone#shearX} and {@link Bone#shearY}. */ +/** Changes {@link Bone.shearX} and {@link Bone.shearY}. */ export class ShearYTimeline extends BoneTimeline1 { constructor (frameCount: number, bezierCount: number, boneIndex: number) { super(frameCount, bezierCount, boneIndex, Property.shearY); @@ -801,7 +808,7 @@ export class InheritTimeline extends Timeline implements BoneTimeline { } /** Sets the inherit transform mode for the specified frame. - * @param frame Between 0 and frameCount, inclusive. + * @param frame Between 0 and `frameCount`, inclusive. * @param time The frame time in seconds. */ public setFrame (frame: number, time: number, inherit: Inherit) { frame *= 2/*ENTRIES*/; @@ -1295,7 +1302,7 @@ export class AttachmentTimeline extends Timeline implements SlotTimeline { export class DeformTimeline extends SlotCurveTimeline { /** The attachment that will be deformed. * - * See {@link VertexAttachment.getTimelineAttachment()}. */ + * See {@link VertexAttachment.getTimelineAttachment}. */ readonly attachment: VertexAttachment; /** The vertices for each key frame. */ @@ -1313,7 +1320,7 @@ export class DeformTimeline extends SlotCurveTimeline { } /** Sets the time and vertices for the specified frame. - * @param frame Between 0 and frameCount, inclusive. + * @param frame Between 0 and `frameCount`, inclusive. * @param time The frame time in seconds. * @param vertices Vertex positions for an unweighted VertexAttachment, or deform offsets if it has weights. */ setFrame (frame: number, time: number, vertices: NumberArrayLike) { @@ -1493,7 +1500,7 @@ export class DeformTimeline extends SlotCurveTimeline { } } -/** Changes {@link Slot#getSequenceIndex()} for an attachment's {@link Sequence}. */ +/** Changes {@link Slot.getSequenceIndex} for an attachment's {@link Sequence}. */ export class SequenceTimeline extends Timeline implements SlotTimeline { static ENTRIES = 3; static MODE = 1; @@ -1518,15 +1525,15 @@ export class SequenceTimeline extends Timeline implements SlotTimeline { return this.slotIndex; } - /** The attachment for which the {@link SlotPose#getSequenceIndex()} will be set. - *

+ /** The attachment for which the {@link SlotPose.getSequenceIndex} will be set. + * * See {@link VertexAttachment.timelineAttachment}. */ getAttachment () { return this.attachment as unknown as Attachment; } /** Sets the time, mode, index, and frame time for the specified frame. - * @param frame Between 0 and frameCount, inclusive. + * @param frame Between 0 and `frameCount`, inclusive. * @param time Seconds between frames. */ setFrame (frame: number, time: number, mode: SequenceMode, index: number, delay: number) { const frames = this.frames; @@ -1645,12 +1652,12 @@ export class EventTimeline extends Timeline { } } -/** Changes the {@link Skeleton#getDrawOrder()}. */ +/** Changes the {@link Skeleton.getDrawOrder}. */ export class DrawOrderTimeline extends Timeline { static readonly propertyID = `${Property.drawOrder}`; static propertyIds = [DrawOrderTimeline.propertyID]; - /** The draw order for each key frame. See {@link #setFrame(int, float, int[])}. */ + /** The draw order for each key frame. See {@link setFrame}. */ private readonly drawOrders: Array | null>; constructor (frameCount: number) { @@ -1664,7 +1671,7 @@ export class DrawOrderTimeline extends Timeline { } /** Sets the time in seconds and the draw order for the specified key frame. - * @param drawOrder Ordered {@link Skeleton#slots} indices, or null to use setup pose + * @param drawOrder Ordered {@link Skeleton.slots} indices, or null to use setup pose * draw order. */ setFrame (frame: number, time: number, drawOrder: Array | null) { this.frames[frame] = time; @@ -1690,13 +1697,13 @@ export class DrawOrderTimeline extends Timeline { } } -/** Changes a subset of the {@link Skeleton#getDrawOrder() draw order}. */ +/** Changes a subset of the {@link Skeleton.getDrawOrder | draw order}. */ export class DrawOrderFolderTimeline extends Timeline { private readonly slots: number[]; private readonly inFolder: boolean[]; private readonly drawOrders: Array | null>; - /** @param slots {@link Skeleton#slots} indices controlled by this timeline, in setup order. + /** @param slots {@link Skeleton.slots} indices controlled by this timeline, in setup order. * @param slotCount The maximum number of slots in the skeleton. */ constructor (frameCount: number, slots: number[], slotCount: number) { super(frameCount, ...DrawOrderFolderTimeline.propertyIds(slots)); @@ -1720,20 +1727,20 @@ export class DrawOrderFolderTimeline extends Timeline { return this.frames.length; } - /** The {@link Skeleton#getSlots()} indices that this timeline affects, in setup order. */ + /** The {@link Skeleton.getSlots} indices that this timeline affects, in setup order. */ getSlots (): number[] { return this.slots; } - /** The draw order for each frame. See {@link #setFrame(int, float, int[])}. */ + /** The draw order for each frame. See {@link setFrame}. */ getDrawOrders (): Array | null> { return this.drawOrders; } /** Sets the time and draw order for the specified frame. - * @param frame Between 0 and frameCount, inclusive. + * @param frame Between 0 and `frameCount`, inclusive. * @param time The frame time in seconds. - * @param drawOrder Ordered {@link #getSlots()} indices, or null to use setup pose order. */ + * @param drawOrder Ordered {@link getSlots} indices, or null to use setup pose order. */ setFrame (frame: number, time: number, drawOrder: Array | null): void { this.frames[frame] = time; this.drawOrders[frame] = drawOrder; @@ -1774,7 +1781,7 @@ export class DrawOrderFolderTimeline extends Timeline { } export interface ConstraintTimeline { - /** The index of the constraint in {@link Skeleton#constraints} that will be changed when this timeline is applied, or -1 if + /** The index of the constraint in {@link Skeleton.constraints} that will be changed when this timeline is applied, or -1 if * a specific constraint will not be changed. */ readonly constraintIndex: number; } @@ -1799,7 +1806,7 @@ export class IkConstraintTimeline extends CurveTimeline implements ConstraintTim } /** Sets the time, mix, softness, bend direction, compress, and stretch for the specified frame. - * @param frame Between 0 and frameCount, inclusive. + * @param frame Between 0 and `frameCount`, inclusive. * @param time The frame time in seconds. * @param bendDirection 1 or -1. */ setFrame (frame: number, time: number, mix: number, softness: number, bendDirection: number, compress: boolean, stretch: boolean) { @@ -1889,7 +1896,7 @@ export class TransformConstraintTimeline extends CurveTimeline implements Constr } /** Sets the time, rotate mix, translate mix, scale mix, and shear mix for the specified frame. - * @param frame Between 0 and frameCount, inclusive. + * @param frame Between 0 and `frameCount`, inclusive. * @param time The frame time in seconds. */ setFrame (frame: number, time: number, mixRotate: number, mixX: number, mixY: number, mixScaleX: number, mixScaleY: number, mixShearY: number) { @@ -2028,8 +2035,8 @@ export class PathConstraintSpacingTimeline extends ConstraintTimeline1 { } } -/** Changes {@link PathConstraint.mixRotate()}, {@link PathConstraint.mixX()}, and - * {@link PathConstraint.mixY()}. */ +/** Changes {@link PathConstraint.mixRotate}, {@link PathConstraint.mixX}, and + * {@link PathConstraint.mixY}. */ export class PathConstraintMixTimeline extends CurveTimeline implements ConstraintTimeline { readonly constraintIndex: number; @@ -2044,7 +2051,7 @@ export class PathConstraintMixTimeline extends CurveTimeline implements Constrai } /** Sets the time and color for the specified frame. - * @param frame Between 0 and frameCount, inclusive. + * @param frame Between 0 and `frameCount`, inclusive. * @param time The frame time in seconds. */ setFrame (frame: number, time: number, mixRotate: number, mixX: number, mixY: number) { const frames = this.frames; @@ -2302,12 +2309,12 @@ export class PhysicsConstraintResetTimeline extends Timeline implements Constrai } /** Sets the time for the specified frame. - * @param frame Between 0 and frameCount, inclusive. */ + * @param frame Between 0 and `frameCount`, inclusive. */ setFrame (frame: number, time: number) { this.frames[frame] = time; } - /** Resets the physics constraint when frames > lastTime and <= time. */ + /** Resets the physics constraint when frames > `lastTime` and <= `time`. */ apply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number, fromSetup: boolean, add: boolean, out: boolean, appliedPose: boolean) { @@ -2338,7 +2345,7 @@ export class PhysicsConstraintResetTimeline extends Timeline implements Constrai } } -/** Changes {@link SliderPose.time()}. */ +/** Changes {@link SliderPose.time}. */ export class SliderTimeline extends ConstraintTimeline1 { constructor (frameCount: number, bezierCount: number, constraintIndex: number) { super(frameCount, bezierCount, constraintIndex, Property.sliderTime); @@ -2356,7 +2363,7 @@ export class SliderTimeline extends ConstraintTimeline1 { } } -/** Changes {@link SliderPose.mix()}. */ +/** Changes {@link SliderPose.mix}. */ export class SliderMixTimeline extends ConstraintTimeline1 { constructor (frameCount: number, bezierCount: number, constraintIndex: number) { super(frameCount, bezierCount, constraintIndex, Property.sliderMix); diff --git a/spine-ts/spine-core/src/AnimationState.ts b/spine-ts/spine-core/src/AnimationState.ts index fb3099ef8..41bb167fd 100644 --- a/spine-ts/spine-core/src/AnimationState.ts +++ b/spine-ts/spine-core/src/AnimationState.ts @@ -53,7 +53,7 @@ export class AnimationState { /** Multiplier for the delta time when the animation state is updated, causing time for all animations and mixes to play slower * or faster. Defaults to 1. * - * See {@link TrackEntry#timeScale} to affect a single animation. */ + * See {@link TrackEntry.timeScale} to affect a single animation. */ timeScale = 1; unkeyedState = 0; @@ -69,7 +69,7 @@ export class AnimationState { this.data = data; } - /** Increments each track entry {@link TrackEntry#trackTime}, setting queued animations as current if needed. */ + /** Increments each track entry {@link TrackEntry.trackTime}, setting queued animations as current if needed. */ update (delta: number) { delta *= this.timeScale; const tracks = this.tracks; @@ -306,7 +306,7 @@ export class AnimationState { return mix; } - /** Applies the attachment timeline and sets {@link Slot#attachmentState}. + /** Applies the attachment timeline and sets {@link Slot.attachmentState}. * @param attachments False when: 1) the attachment timeline is mixing out, 2) mix < attachmentThreshold, and 3) the timeline * is not the last timeline to set the slot's attachment. In that case the timeline is applied only so subsequent * timelines see any deform. */ @@ -423,7 +423,7 @@ export class AnimationState { /** Removes all animations from all tracks, leaving skeletons in their current pose. * - * Usually you want to use {@link #setEmptyAnimations(float)} to mix the skeletons back to the setup pose, rather than leaving + * Usually you want to use {@link setEmptyAnimations} to mix the skeletons back to the setup pose, rather than leaving * them in their current pose. */ clearTracks () { const oldDrainDisabled = this.queue.drainDisabled; @@ -437,7 +437,7 @@ export class AnimationState { /** Removes all animations from the track, leaving skeletons in their current pose. * - * Usually you want to use {@link #setEmptyAnimation(int, float)} to mix the skeletons back to the setup pose, rather than + * Usually you want to use {@link setEmptyAnimation} to mix the skeletons back to the setup pose, rather than * leaving them in their current pose. */ clearTrack (trackIndex: number) { if (trackIndex >= this.tracks.length) return; @@ -512,9 +512,9 @@ export class AnimationState { * If the formerly current track entry is for the same animation and was never applied to a skeleton, it is replaced (not mixed * from). * @param loop If true, the animation will repeat. If false it will not, instead its last frame is applied if played beyond its - * duration. In either case {@link TrackEntry#getTrackEnd()} determines when the track is cleared. + * duration. In either case {@link TrackEntry.getTrackEnd} determines when the track is cleared. * @return A track entry to allow further customization of animation playback. References to the track entry must not be kept - * after the {@link AnimationStateListener#dispose(TrackEntry)} event occurs. */ + * after the {@link AnimationStateListener.dispose} event occurs. */ private setAnimation2 (trackIndex: number, animation: Animation, loop: boolean = false) { if (trackIndex < 0) throw new Error("trackIndex must be >= 0."); if (!animation) throw new Error("animation cannot be null."); @@ -546,7 +546,7 @@ export class AnimationState { /** Adds an animation to be played after the current or last queued animation for a track. If the track has no entries, this is * equivalent to calling {@link setAnimation}. * @param delay If > 0, sets {@link TrackEntry.delay}. If <= 0, the delay set is the duration of the previous track entry - * minus any mix duration (from {@link #data}) plus the specified `delay` (ie the mix ends at (when + * minus any mix duration (from {@link data}) plus the specified `delay` (ie the mix ends at (when * `delay` = 0) or before (when `delay` < 0) the previous track entry duration). If the * previous entry is looping, its next loop completion is used instead of its duration. * @return A track entry to allow further customization of animation playback. References to the track entry must not be kept @@ -591,17 +591,17 @@ export class AnimationState { } /** Sets an empty animation for a track, discarding any queued animations, and sets the track entry's - * {@link TrackEntry#mixduration}. An empty animation has no timelines and serves as a placeholder for mixing in or out. + * {@link TrackEntry.mixduration}. An empty animation has no timelines and serves as a placeholder for mixing in or out. * - * Mixing out is done by setting an empty animation with a mix duration using either {@link #setEmptyAnimation()}, - * {@link #setEmptyAnimations()}, or {@link #addEmptyAnimation()}. Mixing to an empty animation causes + * Mixing out is done by setting an empty animation with a mix duration using either {@link setEmptyAnimation}, + * {@link setEmptyAnimations}, or {@link addEmptyAnimation}. Mixing to an empty animation causes * the previous animation to be applied less and less over the mix duration. Properties keyed in the previous animation * transition to the value from lower tracks or to the setup pose value if no lower tracks key the property. A mix duration of * 0 still needs to be applied one more time to mix out, so the properties it was animating are reverted. * * Mixing in is done by first setting an empty animation, then adding an animation using - * {@link #addAnimation(int, Animation, boolean, float)} with the desired delay (an empty animation has a duration of 0) and on - * the returned track entry, set the {@link TrackEntry#setMixDuration(float)}. Mixing from an empty animation causes the new + * {@link addAnimation} with the desired delay (an empty animation has a duration of 0) and on + * the returned track entry, set the {@link TrackEntry.setMixDuration}. Mixing from an empty animation causes the new * animation to be applied more and more over the mix duration. Properties keyed in the new animation transition from the value * from lower tracks or from the setup pose value if no lower tracks key the property to the value keyed in the new animation. * @@ -615,18 +615,18 @@ export class AnimationState { } /** Adds an empty animation to be played after the current or last queued animation for a track, and sets the track entry's - * {@link TrackEntry#mixDuration}. If the track has no entries, it is equivalent to calling - * {@link #setEmptyAnimation(int, float)}. + * {@link TrackEntry.mixDuration}. If the track has no entries, it is equivalent to calling + * {@link setEmptyAnimation}. * - * See {@link #setEmptyAnimation(int, float)} and + * See {@link setEmptyAnimation} and * Empty animations in the Spine Runtimes * Guide. - * @param delay If > 0, sets {@link TrackEntry#delay}. If <= 0, the delay set is the duration of the previous track entry minus - * any mix duration plus the specified delay (ie the mix ends at (when delay = 0) or before - * (when delay < 0) the previous track entry duration). If the previous entry is looping, its next loop + * @param delay If > 0, sets {@link TrackEntry.delay}. If <= 0, the delay set is the duration of the previous track entry minus + * any mix duration plus the specified `delay` (ie the mix ends at (when `delay` = 0) or before + * (when `delay` < 0) the previous track entry duration). If the previous entry is looping, its next loop * completion is used instead of its duration. * @return A track entry to allow further customization of animation playback. References to the track entry must not be kept - * after the {@link AnimationStateListener#dispose(TrackEntry)} event occurs. */ + * after the {@link AnimationStateListener.dispose} event occurs. */ addEmptyAnimation (trackIndex: number, mixDuration: number = 0, delay: number = 0) { const entry = this.addAnimation(trackIndex, AnimationState.emptyAnimation, false, delay); if (delay <= 0) entry.delay = Math.max(entry.delay + entry.mixDuration - mixDuration, 0); @@ -694,7 +694,7 @@ export class AnimationState { return entry; } - /** Removes {@link TrackEntry#next} and all entries after it for the specified entry. */ + /** Removes {@link TrackEntry.next} and all entries after it for the specified entry. */ clearNext (entry: TrackEntry) { let next = entry.next; while (next) { @@ -783,13 +783,13 @@ export class AnimationState { this.listeners.push(listener); } - /** Removes the listener added with {@link #addListener()}. */ + /** Removes the listener added with {@link addListener}. */ removeListener (listener: AnimationStateListener) { const index = this.listeners.indexOf(listener); if (index >= 0) this.listeners.splice(index, 1); } - /** Removes all listeners added with {@link #addListener()}. */ + /** Removes all listeners added with {@link addListener}. */ clearListeners () { this.listeners.length = 0; } @@ -804,7 +804,7 @@ export class AnimationState { /** Stores settings and other state for the playback of an animation on an {@link AnimationState} track. * - * References to a track entry must not be kept after the {@link AnimationStateListener#dispose()} event occurs. */ + * References to a track entry must not be kept after the {@link AnimationStateListener.dispose} event occurs. */ export class TrackEntry { /** The animation to apply for this track entry. */ animation: Animation | null = null; @@ -815,22 +815,22 @@ export class TrackEntry { next: TrackEntry | null = null; /** The track entry for the previous animation when mixing to this animation, or null if no mixing is currently occurring. - * When mixing from multiple animations, mixingFrom makes up a doubly linked list. */ + * When mixing from multiple animations, `mixingFrom` makes up a doubly linked list. */ mixingFrom: TrackEntry | null = null; /** The track entry for the next animation when mixing from this animation, or null if no mixing is currently occurring. - * When mixing to multiple animations, mixingTo makes up a doubly linked list. */ + * When mixing to multiple animations, `mixingTo` makes up a doubly linked list. */ mixingTo: TrackEntry | null = null; /** The listener for events generated by this track entry, or null. * - * A track entry returned from {@link AnimationState#setAnimation()} is already the current animation - * for the track, so the callback for listener {@link AnimationStateListener#start()} will not be called. */ + * A track entry returned from {@link AnimationState.setAnimation} is already the current animation + * for the track, so the callback for listener {@link AnimationStateListener.start} will not be called. */ listener: AnimationStateListener | null = null; /** The index of the track where this track entry is either current or queued. * - * See {@link AnimationState#getCurrent()}. */ + * See {@link AnimationState.getCurrent}. */ trackIndex = 0; /** If true, the animation will repeat. If false it will not, instead its last frame is applied if played beyond its @@ -838,7 +838,7 @@ export class TrackEntry { loop = false; /** When true, timelines in this animation that support additive have their values added to the setup or current pose values - * instead of replacing them. Additive can be set for a new track entry only before {@link AnimationState#apply(Skeleton)} + * instead of replacing them. Additive can be set for a new track entry only before {@link AnimationState.apply} * is next called. */ additive = false; @@ -851,39 +851,39 @@ export class TrackEntry { * If false, the shortest rotation direction is remembered when the mix starts and the same direction is used for the rest * of the mix. Defaults to false. * - * See {@link #resetRotationDirections()}. */ + * See {@link resetRotationDirections}. */ shortestRotation = false; keepHold = false; - /** When the mix percentage ({@link #mixTime} / {@link #mixDuration}) is less than the `eventThreshold`, event + /** When the mix percentage ({@link mixTime} / {@link mixDuration}) is less than the `eventThreshold`, event * timelines are applied while this animation is being mixed out. Defaults to 0, so event timelines are not applied while * this animation is being mixed out. */ eventThreshold = 0; - /** When the mix percentage ({@link #mixTime} / {@link #mixDuration}) is less than the `mixAttachmentThreshold`, + /** When the mix percentage ({@link mixTime} / {@link mixDuration}) is less than the `mixAttachmentThreshold`, * attachment timelines are applied while this animation is being mixed out. Defaults to 0, so attachment timelines are not * applied while this animation is being mixed out. */ mixAttachmentThreshold = 0; /** When the computed alpha is greater than `alphaAttachmentThreshold`, attachment timelines are applied. The - * computed alpha includes {@link #alpha} and the mix percentage. Defaults to 0, so attachment timelines are always + * computed alpha includes {@link alpha} and the mix percentage. Defaults to 0, so attachment timelines are always * applied. */ alphaAttachmentThreshold = 0; - /** When the mix percentage ({@link #mixTime} / {@link #mixDuration}) is less than the `mixDrawOrderThreshold`, + /** When the mix percentage ({@link mixTime} / {@link mixDuration}) is less than the `mixDrawOrderThreshold`, * draw order timelines are applied while this animation is being mixed out. Defaults to 0, so draw order timelines are not * applied while this animation is being mixed out. */ mixDrawOrderThreshold = 0; /** Seconds when this animation starts, both initially and after looping. Defaults to 0. * - * When changing the `animationStart` time, it often makes sense to set {@link #animationLast} to the same value + * When changing the `animationStart` time, it often makes sense to set {@link animationLast} to the same value * to prevent timeline keys before the start time from triggering. */ animationStart = 0; /** Seconds for the last frame of this animation. Non-looping animations won't play past this time. Looping animations will - * loop back to {@link #animationStart} at this time. Defaults to the animation {@link Animation#duration}. */ + * loop back to {@link animationStart} at this time. Defaults to the animation {@link Animation.duration}. */ animationEnd = 0; @@ -896,19 +896,19 @@ export class TrackEntry { nextAnimationLast = 0; /** Seconds to postpone playing the animation. Must be >= 0. When this track entry is the current track entry, - * `delay` postpones incrementing the {@link #trackTime}. When this track entry is queued, `delay` is + * `delay` postpones incrementing the {@link trackTime}. When this track entry is queued, `delay` is * the time from the start of the previous animation to when this track entry will become the current track entry (ie when - * the previous track entry {@link #trackTime} >= this track entry's `delay`). + * the previous track entry {@link trackTime} >= this track entry's `delay`). * - * {@link #timeScale} affects the delay. + * {@link timeScale} affects the delay. * - * When passing `delay` <= 0 to {@link AnimationState#addAnimation(int, Animation, boolean, float)} this - * `delay` is set using a mix duration from {@link AnimationStateData}. To change the {@link #mixDuration} - * afterward, use {@link #setMixDuration(float, float)} so this `delay` is adjusted. */ + * When passing `delay` <= 0 to {@link AnimationState.addAnimation} this + * `delay` is set using a mix duration from {@link AnimationStateData}. To change the {@link mixDuration} + * afterward, use {@link setMixDuration} so this `delay` is adjusted. */ delay = 0; /** Current time in seconds this track entry has been the current track entry. The track time determines - * {@link #animationTime}. The track time can be set to start the animation at a time other than 0, without affecting + * {@link animationTime}. The track time can be set to start the animation at a time other than 0, without affecting * looping. */ trackTime = 0; @@ -919,23 +919,23 @@ export class TrackEntry { * is reached, no other animations are queued for playback, and mixing from any previous animations is complete, then the * properties keyed by the animation are set to the setup pose and the track is cleared. * - * Usually you want to use {@link AnimationState#addEmptyAnimation()} rather than have the animation + * Usually you want to use {@link AnimationState.addEmptyAnimation} rather than have the animation * abruptly cease being applied. */ trackEnd = 0; /** Multiplier for the delta time when this track entry is updated, causing time for this animation to pass slower or * faster. Defaults to 1. * - * Values < 0 are not supported. To play an animation in reverse, use {@link #reverse}. + * Values < 0 are not supported. To play an animation in reverse, use {@link reverse}. * - * {@link #mixTime} is not affected by track entry time scale, so {@link #mixDuration} may need to be adjusted to match the + * {@link mixTime} is not affected by track entry time scale, so {@link mixDuration} may need to be adjusted to match the * animation speed. * - * When using {@link AnimationState#addAnimation(int, Animation, boolean, float)} with a `delay` <= 0, the - * {@link #delay} is set using the mix duration from {@link AnimationState#data}, assuming time scale to be 1. If the time + * When using {@link AnimationState.addAnimation} with a `delay` <= 0, the + * {@link delay} is set using the mix duration from {@link AnimationState.data}, assuming time scale to be 1. If the time * scale is not 1, the delay may need to be adjusted. * - * See {@link AnimationState#timeScale} to affect all animations. */ + * See {@link AnimationState.timeScale} to affect all animations. */ timeScale = 0; /** Values < 1 mix this animation with the skeleton's current pose (either the setup pose or the pose from lower tracks). @@ -943,26 +943,26 @@ export class TrackEntry { * * Alpha should be 1 on track 0. * - * See {@link #getAlphaAttachmentThreshold()}. */ + * See {@link getAlphaAttachmentThreshold}. */ alpha = 0; - /** Seconds elapsed from 0 to the {@link #mixDuration()} when mixing from the previous animation to this animation. May + /** Seconds elapsed from 0 to the {@link mixDuration} when mixing from the previous animation to this animation. May * be slightly more than `mixDuration` when the mix is complete. */ mixTime = 0; /** Seconds for mixing from the previous animation to this animation. Defaults to the value provided by - * {@link AnimationStateData#getMix(Animation, Animation)} based on the animation before this animation (if any). + * {@link AnimationStateData.getMix} based on the animation before this animation (if any). * * A mix duration of 0 still needs to be applied one more time to mix out, so the the properties it was animating are - * reverted. A mix duration of 0 can be set at any time to end the mix on the next {@link AnimationState#update(float) - * update}. + * reverted. A mix duration of 0 can be set at any time to end the mix on the next + * {@link AnimationState.update | update}. * * The `mixDuration` can be set manually rather than use the value from - * {@link AnimationStateData#getMix(Animation, Animation)}. In that case, the `mixDuration` can be set for a new - * track entry only before {@link AnimationState#update(float)} is next called. + * {@link AnimationStateData.getMix}. In that case, the `mixDuration` can be set for a new + * track entry only before {@link AnimationState.update} is next called. * - * When using {@link AnimationState#addAnimation(int, Animation, boolean, float)} with a `delay` <= 0, the - * {@link #getDelay()} is set using the mix duration from {@link AnimationState#data}. If `mixDuration` is set + * When using {@link AnimationState.addAnimation} with a `delay` <= 0, the + * {@link getDelay} is set using the mix duration from {@link AnimationState.data}. If `mixDuration` is set * afterward, the delay needs to be adjusted: * *

@@ -970,7 +970,7 @@ export class TrackEntry {
 	 * entry.delay = entry.previous.getTrackComplete() - entry.mixDuration + 0;
 	 * 
* - * Alternatively, use {@link #setMixDuration(float, float)} to set both the mix duration and recompute the delay:
+ * Alternatively, use {@link setMixDuration} to set both the mix duration and recompute the delay:
* *
 	  entry.setMixDuration(0.25f, 0); // mixDuration, delay
@@ -980,10 +980,10 @@ export class TrackEntry {
 
 	totalAlpha = 0;
 
-	/** Sets both {@link #getMixDuration()} and {@link #getDelay()}.
-	 * @param delay If > 0, sets {@link #getDelay()}. If <= 0, the delay set is the duration of the previous track entry minus
-	 *           the specified mix duration plus the specified delay (ie the mix ends at (when delay =
-	 *           0) or before (when delay < 0) the previous track entry duration). If the previous entry is
+	/** Sets both {@link getMixDuration} and {@link getDelay}.
+	 * @param delay If > 0, sets {@link getDelay}. If <= 0, the delay set is the duration of the previous track entry minus
+	 *           the specified mix duration plus the specified `delay` (ie the mix ends at (when `delay` =
+	 *           0) or before (when `delay` < 0) the previous track entry duration). If the previous entry is
 	 *           looping, its next loop completion is used instead of its duration. */
 	setMixDuration (mixDuration: number, delay?: number) {
 		this.mixDuration = mixDuration;
@@ -994,8 +994,8 @@ export class TrackEntry {
 	}
 
 	/** For each timeline:
-	 * 
  • Bit 0, FIRST: 0 = mix from current pose, 1 = mix from setup pose. Timeline is first to set the property. - *
  • Bit 1, HOLD: 0 = mix out using alphaMix, 1 = apply full alpha to prevent dipping. Timeline is first on its track to + * - Bit 0, FIRST: 0 = mix from current pose, 1 = mix from setup pose. Timeline is first to set the property. + * - Bit 1, HOLD: 0 = mix out using alphaMix, 1 = apply full alpha to prevent dipping. Timeline is first on its track to * set the property and the next entry (mixingTo) also sets it. When held, timelineHoldMix's mix controls how the hold fades * out (for 3+ entry chains where the chain eventually stops setting the property). */ timelineMode = [] as number[]; @@ -1014,12 +1014,12 @@ export class TrackEntry { this.timelinesRotation.length = 0; } - /** Uses {@link #trackTime} to compute the `animationTime`. When the `trackTime` is 0, the + /** Uses {@link trackTime} to compute the `animationTime`. When the `trackTime` is 0, the * `animationTime` is equal to the `animationStart` time. * - * The `animationTime` is between {@link #animationStart} and {@link #animationEnd}, except if this track entry - * is non-looping and {@link #animationEnd} is >= to the {@link Animation#duration}, then `animationTime` - * continues to increase past {@link #animationEnd}. */ + * The `animationTime` is between {@link animationStart} and {@link animationEnd}, except if this track entry + * is non-looping and {@link animationEnd} is >= to the {@link Animation.duration}, then `animationTime` + * continues to increase past {@link animationEnd}. */ getAnimationTime () { if (this.loop) { const duration = this.animationEnd - this.animationStart; @@ -1036,13 +1036,13 @@ export class TrackEntry { /** Returns true if at least one loop has been completed. * - * See {@link AnimationStateListener#complete()}. */ + * See {@link AnimationStateListener.complete}. */ isComplete () { return this.trackTime >= this.animationEnd - this.animationStart; } - /** When {@link #shortestRotation} is false, this clears the directions for mixing this entry's rotation. This can be useful - * to avoid bones rotating the long way around when using {@link #getAlpha()} and starting animations on other tracks. + /** When {@link shortestRotation} is false, this clears the directions for mixing this entry's rotation. This can be useful + * to avoid bones rotating the long way around when using {@link getAlpha} and starting animations on other tracks. * * Mixing involves finding a rotation between two others. There are two possible solutions: the short or the long way * around. When the two rotations change over time, which direction is the short or long way can also change. If the short @@ -1053,10 +1053,10 @@ export class TrackEntry { this.timelinesRotation.length = 0; } - /** If this track entry is non-looping, this is the track time in seconds when {@link #animationEnd} is reached, or the - * current {@link #trackTime} if it has already been reached. + /** If this track entry is non-looping, this is the track time in seconds when {@link animationEnd} is reached, or the + * current {@link trackTime} if it has already been reached. * - * If this track entry is looping, this is the track time when this animation will reach its next {@link #animationEnd} (the + * If this track entry is looping, this is the track time when this animation will reach its next {@link animationEnd} (the * next loop completion). */ getTrackComplete () { const duration = this.animationEnd - this.animationStart; @@ -1069,13 +1069,13 @@ export class TrackEntry { /** Returns true if this track entry has been applied at least once. * - * See {@link AnimationState#apply(Skeleton)}. */ + * See {@link AnimationState.apply}. */ wasApplied () { return this.nextTrackLast !== -1; } - /** Returns true if there is a {@link #next()} track entry and it will become the current track entry during the next - * {@link AnimationState#update(float)}. */ + /** Returns true if there is a {@link next} track entry and it will become the current track entry during the next + * {@link AnimationState.update}. */ isNextReady () { return this.next != null && this.nextTrackLast - this.next.delay >= 0; } @@ -1199,11 +1199,11 @@ export enum EventType { /** The interface to implement for receiving TrackEntry events. It is always safe to call AnimationState methods when receiving * events. * - * TrackEntry events are collected during {@link AnimationState#update} and {@link AnimationState#apply} and + * TrackEntry events are collected during {@link AnimationState.update} and {@link AnimationState.apply} and * fired only after those methods are finished. * - * See {@link TrackEntry#listener} and - * {@link AnimationState#addListener}. */ + * See {@link TrackEntry.listener} and + * {@link AnimationState.addListener}. */ export interface AnimationStateListener { /** Invoked when this entry has been set as the current entry. {@link end} will occur when this entry will no * longer be applied. @@ -1217,7 +1217,7 @@ export interface AnimationStateListener { interrupt?: (entry: TrackEntry) => void; /** Invoked when this entry will never be applied again. This only occurs if this entry has previously been set as the - * current entry ({@link #start(TrackEntry)} was invoked). */ + * current entry ({@link start} was invoked). */ end?: (entry: TrackEntry) => void; /** Invoked when this entry will be disposed. This may occur without the entry ever being set as the current entry. @@ -1225,11 +1225,11 @@ export interface AnimationStateListener { dispose?: (entry: TrackEntry) => void; /** Invoked every time this entry's animation completes a loop. This may occur during mixing (after - * {@link #interrupt(TrackEntry)}). + * {@link interrupt}). * - * If this entry's {@link TrackEntry#mixingTo} is not null, this entry is mixing out (it is not the current entry). + * If this entry's {@link TrackEntry.mixingTo} is not null, this entry is mixing out (it is not the current entry). * - * Because this event is triggered at the end of {@link AnimationState#apply(Skeleton)}, any animations set in response to + * Because this event is triggered at the end of {@link AnimationState.apply}, any animations set in response to * the event won't be applied until the next time the AnimationState is applied. */ complete?: (entry: TrackEntry) => void; diff --git a/spine-ts/spine-core/src/AnimationStateData.ts b/spine-ts/spine-core/src/AnimationStateData.ts index df9ac3e4c..3cedced99 100644 --- a/spine-ts/spine-core/src/AnimationStateData.ts +++ b/spine-ts/spine-core/src/AnimationStateData.ts @@ -28,6 +28,7 @@ *****************************************************************************/ import type { Animation } from "./Animation.js"; +import type { AnimationState, TrackEntry } from "./AnimationState.js"; import type { SkeletonData } from "./SkeletonData.js"; import type { StringMap } from "./Utils.js"; @@ -49,12 +50,12 @@ export class AnimationStateData { /** Sets a mix duration by animation name. * - * See {@link #setMix()}. */ + * See {@link setMix}. */ setMix (fromName: string, to: string, duration: number): void; /** Sets the mix duration when changing from the specified animation to the other. * - * See {@link TrackEntry#mixDuration}. */ + * See {@link TrackEntry.mixDuration}. */ setMix (from: Animation, to: Animation, duration: number): void; setMix (from: string | Animation, to: string | Animation, duration: number) { @@ -79,7 +80,7 @@ export class AnimationStateData { } /** Returns the mix duration to use when changing from the specified animation to the other on the same track, or the - * {@link #defaultMix} if no mix duration has been set. */ + * {@link defaultMix} if no mix duration has been set. */ getMix (from: Animation, to: Animation) { const key = `${from.name}.${to.name}`; const value = this.animationToMixTime[key]; diff --git a/spine-ts/spine-core/src/AtlasAttachmentLoader.ts b/spine-ts/spine-core/src/AtlasAttachmentLoader.ts index 8702b0ddb..53d423e7c 100644 --- a/spine-ts/spine-core/src/AtlasAttachmentLoader.ts +++ b/spine-ts/spine-core/src/AtlasAttachmentLoader.ts @@ -51,15 +51,15 @@ export class AtlasAttachmentLoader implements AttachmentLoader { this.allowMissingRegions = allowMissingRegions; } - /** Sets each {@link Sequence#regions} by calling {@link #findRegion(String, String)} for each texture region using - * {@link Sequence#getPath(String, int)}. */ + /** Sets each {@link Sequence.regions} by calling {@link findRegion} for each texture region using + * {@link Sequence.getPath}. */ protected findRegions (name: string, basePath: string, sequence: Sequence) { const regions = sequence.regions; for (let i = 0, n = regions.length; i < n; i++) regions[i] = this.findRegion(name, sequence.getPath(basePath, i)); } - /** Looks for the region with the specified path. If not found and {@link #allowMissingRegions} is false, an error is + /** Looks for the region with the specified path. If not found and {@link allowMissingRegions} is false, an error is * raised. */ protected findRegion (name: string, path: string) { const region = this.atlas.findRegion(path); diff --git a/spine-ts/spine-core/src/Bone.ts b/spine-ts/spine-core/src/Bone.ts index 4e329b0df..b077f0441 100644 --- a/spine-ts/spine-core/src/Bone.ts +++ b/spine-ts/spine-core/src/Bone.ts @@ -30,16 +30,15 @@ import type { BoneData } from "./BoneData.js"; import { BonePose } from "./BonePose.js"; import { PosedActive } from "./PosedActive.js"; +import type { Skeleton } from "./Skeleton.js"; /** A node in a skeleton's hierarchy with a transform that affects its children and their attachments. A bone has a number of * poses: - *
      - *
    • {@link #data}: The setup pose. - *
    • {@link #pose}: The unconstrained local pose. Set by animations and application code. - *
    • {@link #appliedPose}: The local pose to use for rendering. Possibly modified by constraints. - *
    • World transform: the local pose combined with the parent world transform. Computed on a pose by - * {@link BonePose#updateWorldTransform(Skeleton)} and {@link Skeleton#updateWorldTransform(Physics)}. - *
    + * - {@link data}: The setup pose. + * - {@link pose}: The unconstrained local pose. Set by animations and application code. + * - {@link appliedPose}: The local pose to use for rendering. Possibly modified by constraints. + * - World transform: the local pose combined with the parent world transform. Computed on a pose by + * {@link BonePose.updateWorldTransform} and {@link Skeleton.updateWorldTransform}. */ export class Bone extends PosedActive { /** The parent bone, or null if this is the root bone. */ @@ -57,7 +56,7 @@ export class Bone extends PosedActive { this.constrainedPose.bone = this; } - /** Copy constructor. Does not copy the {@link #children} bones. */ + /** Copy constructor. Does not copy the {@link children} bones. */ copy (parent: Bone | null): Bone { const copy = new Bone(this.data, parent); copy.pose.set(this.pose); diff --git a/spine-ts/spine-core/src/BonePose.ts b/spine-ts/spine-core/src/BonePose.ts index ff0106c18..fe6b5f820 100644 --- a/spine-ts/spine-core/src/BonePose.ts +++ b/spine-ts/spine-core/src/BonePose.ts @@ -35,14 +35,14 @@ import type { Skeleton } from "./Skeleton.js"; import type { Update } from "./Update.js"; import { MathUtils, type Vector2 } from "./Utils.js"; -/** The applied local pose and world transform for a bone. This is the {@link Bone#getPose()} with constraints applied and the - * world transform computed by {@link Skeleton#updateWorldTransform(Physics)} and {@link #updateWorldTransform(Skeleton)}. - *

    - * If the world transform is changed, call {@link #updateLocalTransform(Skeleton)} before using the local transform. The local +/** The applied local pose and world transform for a bone. This is the {@link Bone.getPose} with constraints applied and the + * world transform computed by {@link Skeleton.updateWorldTransform} and {@link updateWorldTransform}. + * + * If the world transform is changed, call {@link updateLocalTransform} before using the local transform. The local * transform may be needed by other code (eg to apply another constraint). - *

    - * After changing the world transform, call {@link #updateWorldTransform(Skeleton)} on every descendant bone. It may be more - * convenient to modify the local transform instead, then call {@link Skeleton#updateWorldTransform(Physics)} to update the world + * + * After changing the world transform, call {@link updateWorldTransform} on every descendant bone. It may be more + * convenient to modify the local transform instead, then call {@link Skeleton.updateWorldTransform} to update the world * transforms for all bones and apply constraints. */ export class BonePose implements Pose, Update { bone!: Bone; @@ -70,22 +70,22 @@ export class BonePose implements Pose, Update { inherit = Inherit.Normal; - /** The world transform [a b][c d] x-axis x component. */ + /** The world transform `[a b][c d]` x-axis x component. */ a = 0; - /** The world transform [a b][c d] y-axis x component. */ + /** The world transform `[a b][c d]` y-axis x component. */ b = 0; - /** The world transform [a b][c d] x-axis y component. */ + /** The world transform `[a b][c d]` x-axis y component. */ c = 0; - /** The world transform [a b][c d] y-axis y component. */ + /** The world transform `[a b][c d]` y-axis y component. */ d = 0; - /** The world X position. If changed, {@link updateLocalTransform()} should be called. */ + /** The world X position. If changed, {@link updateLocalTransform} should be called. */ worldY = 0; - /** The world Y position. If changed, {@link updateLocalTransform()} should be called. */ + /** The world Y position. If changed, {@link updateLocalTransform} should be called. */ worldX = 0; world = 0; @@ -125,7 +125,7 @@ export class BonePose implements Pose, Update { this.inherit = inherit; } - /** Called by {@link Skeleton#updateCache()} to compute the world transform, if needed. */ + /** Called by {@link Skeleton.updateCache} to compute the world transform, if needed. */ public update (skeleton: Skeleton, physics: Physics): void { if (this.world !== skeleton._update) this.updateWorldTransform(skeleton); } @@ -249,11 +249,11 @@ export class BonePose implements Pose, Update { } /** Computes the local transform values from the world transform. - *

    - * If the world transform is modified (by a constraint, {@link #rotateWorld(float)}, etc) then this method should be called so + * + * If the world transform is modified (by a constraint, {@link rotateWorld}, etc) then this method should be called so * the local transform matches the world transform. The local transform may be needed by other code (eg to apply another * constraint). - *

    + * * Some information is ambiguous in the world transform, such as -1,-1 scale versus 180 rotation. The local transform after * calling this method is equivalent to the local transform used to compute the world transform, but may not be identical. */ public updateLocalTransform (skeleton: Skeleton): void { @@ -340,7 +340,7 @@ export class BonePose implements Pose, Update { } /** If the world transform has been modified by constraints and the local transform no longer matches, - * {@link #updateLocalTransform(Skeleton)} is called. Call this after {@link Skeleton#updateWorldTransform(Physics)} before + * {@link updateLocalTransform} is called. Call this after {@link Skeleton.updateWorldTransform} before * using the applied local transform. */ public validateLocalTransform (skeleton: Skeleton): void { if (this.local === skeleton._update) this.updateLocalTransform(skeleton); @@ -370,7 +370,7 @@ export class BonePose implements Pose, Update { } } - /** The world rotation for the X axis, calculated using {@link #a} and {@link #c}. This is the direction the bone is + /** The world rotation for the X axis, calculated using {@link a} and {@link c}. This is the direction the bone is * pointing. */ public getWorldRotationX (): number { return MathUtils.atan2Deg(this.c, this.a); diff --git a/spine-ts/spine-core/src/DrawOrder.ts b/spine-ts/spine-core/src/DrawOrder.ts index 0c76c79c3..9ecb14c33 100644 --- a/spine-ts/spine-core/src/DrawOrder.ts +++ b/spine-ts/spine-core/src/DrawOrder.ts @@ -38,8 +38,8 @@ export class DrawOrder { readonly pose: Slot[]; readonly constrainedPose: Slot[]; - /** The constrained draw order for rendering. If no constraints modify the draw order, this is the same as {@link #pose}. - * Otherwise it is a copy of {@link #pose} modified by constraints. */ + /** The constrained draw order for rendering. If no constraints modify the draw order, this is the same as {@link pose}. + * Otherwise it is a copy of {@link pose} modified by constraints. */ appliedPose: Slot[]; constructor (setupPose: Slot[]) { diff --git a/spine-ts/spine-core/src/Event.ts b/spine-ts/spine-core/src/Event.ts index 2099cc7b1..89546da78 100644 --- a/spine-ts/spine-core/src/Event.ts +++ b/spine-ts/spine-core/src/Event.ts @@ -28,14 +28,14 @@ *****************************************************************************/ -import type { Timeline } from "./Animation.js"; +import type { EventTimeline, Timeline } from "./Animation.js"; import type { AnimationStateListener } from "./AnimationState.js"; import type { EventData } from "./EventData.js"; /** Fired by {@link EventTimeline} when specific animation times are reached. * - * See Timeline {@link Timeline.apply()}, - * AnimationStateListener {@link AnimationStateListener.event()}, and + * See Timeline {@link Timeline.apply}, + * AnimationStateListener {@link AnimationStateListener.event}, and * [Events](http://esotericsoftware.com/spine-events) in the Spine User Guide. */ export class Event { diff --git a/spine-ts/spine-core/src/EventData.ts b/spine-ts/spine-core/src/EventData.ts index fced9400e..77926671b 100644 --- a/spine-ts/spine-core/src/EventData.ts +++ b/spine-ts/spine-core/src/EventData.ts @@ -28,6 +28,7 @@ *****************************************************************************/ import { Event } from "./Event.js"; +import type { SkeletonData } from "./SkeletonData.js"; /** Stores the setup pose values for an {@link Event}. * @@ -35,7 +36,7 @@ import { Event } from "./Event.js"; export class EventData { /** The name of the event, unique across all events in the skeleton. * - * See {@link SkeletonData#findEvent(String)}. */ + * See {@link SkeletonData.findEvent}. */ name: string; _audioPath: string | null = null; diff --git a/spine-ts/spine-core/src/IkConstraintData.ts b/spine-ts/spine-core/src/IkConstraintData.ts index 9e283719e..2a17ab024 100644 --- a/spine-ts/spine-core/src/IkConstraintData.ts +++ b/spine-ts/spine-core/src/IkConstraintData.ts @@ -48,7 +48,7 @@ export class IkConstraintData extends ConstraintData { compress = false; /** When true and the target is out of range, the parent bone is scaled to reach it. - *

    - * For two bone IK: 1) the child bone's local Y translation is set to 0, 2) stretch is not applied if {@link #softness} is > 0, + * + * For two bone IK: 1) the child bone's local Y translation is set to 0, 2) stretch is not applied if {@link softness} is > 0, * and 3) if the parent bone has local nonuniform scale, stretch is not applied. */ stretch = false; diff --git a/spine-ts/spine-core/src/Physics.ts b/spine-ts/spine-core/src/Physics.ts index 748996922..3218d8352 100644 --- a/spine-ts/spine-core/src/Physics.ts +++ b/spine-ts/spine-core/src/Physics.ts @@ -27,12 +27,13 @@ * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ +import type { PhysicsConstraint } from "./PhysicsConstraint.js"; /** Determines how physics and other non-deterministic updates are applied. */ export enum Physics { /** Physics are not updated or applied. */ none, - /** Physics are {@link PhysicsConstraint#reset() reset}. */ + /** Physics are {@link PhysicsConstraint.reset | reset}. */ reset, /** Physics are updated and the pose from physics is applied. */ diff --git a/spine-ts/spine-core/src/PhysicsConstraint.ts b/spine-ts/spine-core/src/PhysicsConstraint.ts index 34dd1585d..517ae6e76 100644 --- a/spine-ts/spine-core/src/PhysicsConstraint.ts +++ b/spine-ts/spine-core/src/PhysicsConstraint.ts @@ -37,7 +37,7 @@ import { MathUtils } from "./Utils.js"; /** Applies physics to a bone. - *

    + * * See Physics constraints in the Spine User Guide. */ export class PhysicsConstraint extends Constraint { bone: BonePose; @@ -97,7 +97,7 @@ export class PhysicsConstraint extends Constraint + * * See Physics constraints in the Spine User Guide. */ export class PhysicsConstraintData extends ConstraintData { /** The bone constrained by this physics constraint. */ diff --git a/spine-ts/spine-core/src/PhysicsConstraintPose.ts b/spine-ts/spine-core/src/PhysicsConstraintPose.ts index 2caf62eff..92dfe0bea 100644 --- a/spine-ts/spine-core/src/PhysicsConstraintPose.ts +++ b/spine-ts/spine-core/src/PhysicsConstraintPose.ts @@ -28,6 +28,7 @@ *****************************************************************************/ import type { Pose } from "./Pose" +import type { Skeleton } from "./Skeleton.js"; /** Stores a pose for a physics constraint. */ export class PhysicsConstraintPose implements Pose { @@ -44,10 +45,10 @@ export class PhysicsConstraintPose implements Pose { /** Determines susceptibility to acceleration. */ massInverse = 0; - /** Applies a constant force along the {@link Skeleton#windX}, {@link Skeleton#windY} vector. */ + /** Applies a constant force along the {@link Skeleton.windX}, {@link Skeleton.windY} vector. */ wind = 0; - /** Applies a constant force along the {@link Skeleton#gravityX}, {@link Skeleton#gravityY} vector. */ + /** Applies a constant force along the {@link Skeleton.gravityX}, {@link Skeleton.gravityY} vector. */ gravity = 0; /** A percentage (0+) that controls the mix between the constrained and unconstrained poses. */ diff --git a/spine-ts/spine-core/src/Posed.ts b/spine-ts/spine-core/src/Posed.ts index fe5226c13..5f3220001 100644 --- a/spine-ts/spine-core/src/Posed.ts +++ b/spine-ts/spine-core/src/Posed.ts @@ -31,11 +31,9 @@ import type { Pose } from "./Pose.js"; import type { PosedData } from "./PosedData.js"; /** The base class for an object with a number of poses: - *

      - *
    • {@link #data}: The setup pose. - *
    • {@link #pose}: The unconstrained pose. Set by animations and application code. - *
    • {@link #appliedPose}: The pose to use for rendering. Possibly modified by constraints. - *
    + * - {@link data}: The setup pose. + * - {@link pose}: The unconstrained pose. Set by animations and application code. + * - {@link appliedPose}: The pose to use for rendering. Possibly modified by constraints. */ export abstract class Posed< D extends PosedData

    , @@ -70,8 +68,8 @@ export abstract class Posed< return this.pose; } - /** The pose to use for rendering. If no constraints modify this pose, this is the same as {@link #pose}. Otherwise it is a - * copy of {@link #pose} modified by constraints. */ + /** The pose to use for rendering. If no constraints modify this pose, this is the same as {@link pose}. Otherwise it is a + * copy of {@link pose} modified by constraints. */ public getAppliedPose (): P { return this.appliedPose; } diff --git a/spine-ts/spine-core/src/PosedActive.ts b/spine-ts/spine-core/src/PosedActive.ts index 62bb4b382..996919248 100644 --- a/spine-ts/spine-core/src/PosedActive.ts +++ b/spine-ts/spine-core/src/PosedActive.ts @@ -32,6 +32,7 @@ import { Posed } from "./Posed.js"; import type { PosedData } from "./PosedData.js"; import type { Skeleton } from "./Skeleton"; +import type { Skin } from "./Skin.js"; /** A posed object that may be active or inactive. */ export abstract class PosedActive< @@ -47,9 +48,9 @@ export abstract class PosedActive< } /** Returns false when this constraint won't be updated by - * {@link Skeleton#updateWorldTransform(com.esotericsoftware.spine.Physics)} because a skin is required and the - * {@link Skeleton#skin active skin} does not contain this item. See {@link Skin#bones}, {@link Skin#constraints}, - * {@link PosedData#skinRequired}, and {@link Skeleton#updateCache()}. */ + * {@link Skeleton.updateWorldTransform} because a skin is required and the + * {@link Skeleton.skin active skin} does not contain this item. See {@link Skin.bones}, {@link Skin.constraints}, + * {@link PosedData.skinRequired}, and {@link Skeleton.updateCache}. */ public isActive (): boolean { return this.active; } diff --git a/spine-ts/spine-core/src/PosedData.ts b/spine-ts/spine-core/src/PosedData.ts index baad05b9a..ba0c137b6 100644 --- a/spine-ts/spine-core/src/PosedData.ts +++ b/spine-ts/spine-core/src/PosedData.ts @@ -28,6 +28,8 @@ *****************************************************************************/ import type { Pose } from "./Pose.js"; +import type { Skeleton } from "./Skeleton.js"; +import type { Skin } from "./Skin.js"; /** The base class for storing setup data for a posed object. May be shared with multiple instances. */ export abstract class PosedData

    > { @@ -35,10 +37,10 @@ export abstract class PosedData

    > { readonly setupPose: P; - /** When true, {@link Skeleton#updateWorldTransform(Physics)} only updates this constraint if the {@link Skeleton#skin} + /** When true, {@link Skeleton.updateWorldTransform} only updates this constraint if the {@link Skeleton.skin} * contains this constraint. - *

    - * See {@link Skin#constraints}. */ + * + * See {@link Skin.constraints}. */ skinRequired = false; constructor (name: string, setupPose: P) { diff --git a/spine-ts/spine-core/src/Skeleton.ts b/spine-ts/spine-core/src/Skeleton.ts index 00587acc7..e7280b976 100644 --- a/spine-ts/spine-core/src/Skeleton.ts +++ b/spine-ts/spine-core/src/Skeleton.ts @@ -27,6 +27,7 @@ * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ +import type { AnimationState } from "./AnimationState.js"; import type { Attachment } from "./attachments/Attachment.js"; import { ClippingAttachment } from "./attachments/ClippingAttachment.js"; import { MeshAttachment } from "./attachments/MeshAttachment.js"; @@ -35,6 +36,7 @@ import { Bone } from "./Bone.js"; import type { Constraint } from "./Constraint.js"; import { DrawOrder } from "./DrawOrder.js"; import type { Physics } from "./Physics.js"; +import type { PhysicsConstraintPose } from "./PhysicsConstraintPose.js"; import { PhysicsConstraint } from "./PhysicsConstraint.js"; import type { Posed } from "./Posed.js"; import type { SkeletonClipping } from "./SkeletonClipping.js"; @@ -46,7 +48,7 @@ import { Color, type NumberArrayLike, Utils, Vector2 } from "./Utils.js"; /** Stores bones and slots to be posed by animations and application code. Multiple skeleton instances can share the same * {@link SkeletonData}, including animations, attachments, and skins. * - * After posing, call {@link #updateWorldTransform(Physics)} to apply constraints and compute world transforms for rendering. + * After posing, call {@link updateWorldTransform} to apply constraints and compute world transforms for rendering. * * See [Instance objects](http://esotericsoftware.com/spine-runtime-architecture#Instance-objects) in the Spine Runtimes Guide. */ export class Skeleton { @@ -62,10 +64,10 @@ export class Skeleton { /** The skeleton's bones, sorted parent first. The root bone is always the first bone. */ readonly bones: Array; - /** The skeleton's slots. To add a slot, also add it to {@link DrawOrder#pose}. */ + /** The skeleton's slots. To add a slot, also add it to {@link DrawOrder.pose}. */ readonly slots: Array; - /** The skeleton's draw order. Use {@link DrawOrder#appliedPose} for rendering and {@link DrawOrder#pose} for changing the draw + /** The skeleton's draw order. Use {@link DrawOrder.appliedPose} for rendering and {@link DrawOrder.pose} for changing the draw * order. */ readonly drawOrder: DrawOrder; @@ -76,7 +78,7 @@ export class Skeleton { /** The skeleton's physics constraints. */ readonly physics: Array; - /** The list of bones and constraints, sorted in the order they should be updated, as computed by {@link updateCache()}. */ + /** The list of bones and constraints, sorted in the order they should be updated, as computed by {@link updateCache}. */ // biome-ignore lint/suspicious/noExplicitAny: reference runtime does not restrict to specific types readonly _updateCache = [] as any[]; @@ -119,19 +121,19 @@ export class Skeleton { /** Returns the skeleton's time, is used for time-based manipulations, such as {@link PhysicsConstraint}. * - * See {@link _update()}. */ + * See {@link _update}. */ time = 0; - /** The x component of a vector that defines the direction {@link PhysicsConstraintPose#wind} is applied. */ + /** The x component of a vector that defines the direction {@link PhysicsConstraintPose.wind} is applied. */ windX = 1; - /** The y component of a vector that defines the direction {@link PhysicsConstraintPose#wind} is applied. */ + /** The y component of a vector that defines the direction {@link PhysicsConstraintPose.wind} is applied. */ windY = 0; - /** The x component of a vector that defines the direction {@link PhysicsConstraintPose#gravity} is applied. */ + /** The x component of a vector that defines the direction {@link PhysicsConstraintPose.gravity} is applied. */ gravityX = 0; - /** The y component of a vector that defines the direction {@link PhysicsConstraintPose#gravity} is applied. */ + /** The y component of a vector that defines the direction {@link PhysicsConstraintPose.gravity} is applied. */ gravityY = 1; _update = 0; @@ -173,7 +175,7 @@ export class Skeleton { this.updateCache(); } - /** Caches information about bones and constraints. Must be called if the {@link #skin} is modified or if bones, constraints, + /** Caches information about bones and constraints. Must be called if the {@link skin} is modified or if bones, constraints, * or weighted path attachments are added or removed. */ updateCache () { this._updateCache.length = 0; @@ -254,7 +256,7 @@ export class Skeleton { } /** Updates the world transform for each bone and applies all constraints. - *

    + * * See World transforms in the Spine * Runtimes Guide. */ updateWorldTransform (physics: Physics): void { @@ -323,17 +325,17 @@ export class Skeleton { /** Sets a skin by name. * - * See {@link setSkin()}. */ + * See {@link setSkin}. */ setSkin (skinName: string): void; - /** Sets the skin used to look up attachments before looking in {@link SkeletonData#defaultSkin}. If the skin is changed, - * {@link #updateCache()} is called. - *

    + /** Sets the skin used to look up attachments before looking in {@link SkeletonData.defaultSkin}. If the skin is changed, + * {@link 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 - * {@link #setupPoseSlots()}. Also, often {@link AnimationState#apply(Skeleton)} is called before the next time the skeleton is + * {@link setupPoseSlots}. Also, often {@link 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. */ setSkin (newSkin: Skin | null): void; @@ -374,7 +376,7 @@ export class Skeleton { /** Finds an attachment by looking in the {@link skin} and {@link SkeletonData.defaultSkin} using the slot name and attachment * name. * - * See {@link getAttachment(number, string)}. */ + * See {@link getAttachment}. */ getAttachment (slotName: string, placeholderName: string): Attachment | null; /** Finds an attachment by looking in the {@link skin} and {@link SkeletonData.defaultSkin} using the slot index and @@ -389,10 +391,10 @@ export class Skeleton { return this.getAttachmentByIndex(slotNameOrIndex, placeholderName); } - /** Finds an attachment by looking in the {@link #skin} and {@link SkeletonData#defaultSkin} using the slot name and attachment + /** Finds an attachment by looking in the {@link skin} and {@link SkeletonData.defaultSkin} using the slot name and attachment * name. * - * See {@link #getAttachment()}. + * See {@link getAttachment}. * @returns May be null. */ private getAttachmentByName (slotName: string, placeholderName: string): Attachment | null { const slot = this.data.findSlot(slotName); @@ -400,7 +402,7 @@ export class Skeleton { return this.getAttachment(slot.index, placeholderName); } - /** Finds an attachment by looking in the {@link #skin} and {@link SkeletonData#defaultSkin} using the slot index and + /** Finds an attachment by looking in the {@link skin} and {@link SkeletonData.defaultSkin} using the slot index and * attachment name. First the skin is checked and if the attachment was not found, the default skin is checked. * * See [Runtime skins](http://esotericsoftware.com/spine-runtime-skins) in the Spine Runtimes Guide. @@ -415,8 +417,8 @@ export class Skeleton { return null; } - /** A convenience method to set an attachment by finding the slot with {@link findSlot()}, finding the attachment with - * {@link getAttachment()}, then setting the slot's {@link Slot.attachment}. + /** A convenience method to set an attachment by finding the slot with {@link findSlot}, finding the attachment with + * {@link getAttachment}, then setting the slot's {@link Slot.attachment}. * @param attachmentName May be null to clear the slot's attachment. */ setAttachment (slotName: string, attachmentName: string | null) { if (!slotName) throw new Error("slotName cannot be null."); @@ -461,7 +463,7 @@ export class Skeleton { * @param offset An output value, the distance from the skeleton origin to the bottom left corner of the AABB. * @param size An output value, the width and height of the AABB. * @param temp Working memory to temporarily store attachments' computed world vertices. - * @param clipper {@link SkeletonClipping} to use. If null, no clipping is applied. */ + * @param clipper {@link SkeletonClipping} to use. If `null`, no clipping is applied. */ getBounds (offset: Vector2, size: Vector2, temp: Array = new Array(2), clipper: SkeletonClipping | null = null) { if (!offset) throw new Error("offset cannot be null."); if (!size) throw new Error("size cannot be null."); @@ -528,7 +530,7 @@ export class Skeleton { this.y = y; } - /** Increments the skeleton's {@link #time}. */ + /** Increments the skeleton's {@link time}. */ update (delta: number) { this.time += delta; } diff --git a/spine-ts/spine-core/src/SkeletonBounds.ts b/spine-ts/spine-core/src/SkeletonBounds.ts index 9f767bf7d..8d88b751a 100644 --- a/spine-ts/spine-core/src/SkeletonBounds.ts +++ b/spine-ts/spine-core/src/SkeletonBounds.ts @@ -151,7 +151,7 @@ export class SkeletonBounds { } /** Returns the first bounding box attachment that contains the point, or null. When doing many checks, it is usually more - * efficient to only call this method if {@link #aabbContainsPoint(float, float)} returns true. */ + * efficient to only call this method if {@link aabbContainsPoint} returns true. */ containsPoint (x: number, y: number): BoundingBoxAttachment | null { const polygons = this.polygons; for (let i = 0, n = polygons.length; i < n; i++) @@ -179,7 +179,7 @@ export class SkeletonBounds { } /** Returns the first bounding box attachment that contains any part of the line segment, or null. When doing many checks, it - * is usually more efficient to only call this method if {@link #aabbIntersectsSegment()} returns + * is usually more efficient to only call this method if {@link aabbIntersectsSegment} returns * true. */ intersectsSegment (x1: number, y1: number, x2: number, y2: number) { const polygons = this.polygons; diff --git a/spine-ts/spine-core/src/SkeletonData.ts b/spine-ts/spine-core/src/SkeletonData.ts index db3482b7d..2e543445e 100644 --- a/spine-ts/spine-core/src/SkeletonData.ts +++ b/spine-ts/spine-core/src/SkeletonData.ts @@ -27,7 +27,8 @@ * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ -import type { Animation } from "./Animation.js" +import type { Animation } from "./Animation.js"; +import type { Skeleton } from "./Skeleton.js"; import type { BoneData } from "./BoneData.js"; import type { ConstraintData } from "./ConstraintData.js"; import type { EventData } from "./EventData.js"; @@ -54,7 +55,7 @@ export class SkeletonData { /** The skeleton's default skin. By default this skin contains all attachments that were not in a skin in Spine. * - * See {@link Skeleton#getAttachmentByName()}. + * See {@link Skeleton.getAttachmentByName}. * May be null. */ defaultSkin: Skin | null = null; @@ -145,7 +146,7 @@ export class SkeletonData { } /** Collects animations used by {@link SliderData slider constraints}. - *

    + * * Slider animations are designed to be applied by slider constraints rather than on their own. Applications that have a user * choose an animation may want to exclude them. */ findSliderAnimations (animations: Animation[]): Animation[] { diff --git a/spine-ts/spine-core/src/Skin.ts b/spine-ts/spine-core/src/Skin.ts index 54bb2668e..e2e342733 100644 --- a/spine-ts/spine-core/src/Skin.ts +++ b/spine-ts/spine-core/src/Skin.ts @@ -28,6 +28,7 @@ *****************************************************************************/ import type { Attachment } from "./attachments/Attachment.js"; +import type { SkeletonData } from "./SkeletonData.js"; import { MeshAttachment } from "./attachments/MeshAttachment.js"; import type { BoneData } from "./BoneData.js"; import type { ConstraintData } from "./ConstraintData.js"; @@ -37,7 +38,7 @@ import { Color, type StringMap } from "./Utils.js"; /** Stores an entry in the skin consisting of the slot index, name, and attachment **/ export class SkinEntry { - /** The {@link Skeleton#slots} index. */ + /** The {@link Skeleton.slots} index. */ slotIndex: number = 0; placeholderName: string; @@ -54,12 +55,12 @@ export class SkinEntry { /** Stores attachments by slot index and placeholder name. Multiple {@link Skeleton} instances can use the same skins. * - * See {@link SkeletonData#defaultSkin}, {@link Skeleton#skin}, and + * See {@link SkeletonData.defaultSkin}, {@link Skeleton.skin}, and * [Runtime skins](http://esotericsoftware.com/spine-runtime-skins) in the Spine Runtimes Guide. */ export class Skin { /** The skin's name, unique across all skins in the skeleton. - *

    - * See {@link SkeletonData#findSkin(String)}. */ + * + * See {@link SkeletonData.findSkin}. */ name: string; attachments = [] as StringMap[]; diff --git a/spine-ts/spine-core/src/Slider.ts b/spine-ts/spine-core/src/Slider.ts index f65e57e18..0cbbb2f2c 100644 --- a/spine-ts/spine-core/src/Slider.ts +++ b/spine-ts/spine-core/src/Slider.ts @@ -35,13 +35,13 @@ import type { Skeleton } from "./Skeleton.js"; import type { SliderData } from "./SliderData.js"; import { SliderPose } from "./SliderPose.js"; -/** Applies an animation based on either the slider's {@link SliderPose#time} or a bone's transform property. - *

    +/** Applies an animation based on either the slider's {@link SliderPose.time} or a bone's transform property. + * * See Sliders in the Spine User Guide. */ export class Slider extends Constraint { private static readonly offsets = [0, 0, 0, 0, 0, 0]; - /** When set, the bone's transform property is used to set the slider's {@link SliderPose#time}. */ + /** When set, the bone's transform property is used to set the slider's {@link SliderPose.time}. */ bone: Bone | null = null; constructor (data: SliderData, skeleton: Skeleton) { diff --git a/spine-ts/spine-core/src/SliderData.ts b/spine-ts/spine-core/src/SliderData.ts index e19d61eb1..ddf460938 100644 --- a/spine-ts/spine-core/src/SliderData.ts +++ b/spine-ts/spine-core/src/SliderData.ts @@ -35,7 +35,7 @@ import { Slider } from "./Slider.js"; import { SliderPose } from "./SliderPose.js"; import type { FromProperty } from "./TransformConstraintData.js"; -/** Stores the setup pose for a {@link SliderConstraint}. +/** Stores the setup pose for a {@link Slider}. * * See Slider constraints in the Spine User Guide. */ export class SliderData extends ConstraintData { @@ -49,13 +49,13 @@ export class SliderData extends ConstraintData { /** When true, the animation repeats after its duration, otherwise the last frame is used. */ loop = false; - /** When set, the bone's transform property is used to set the slider's {@link SliderPose#time}. */ + /** When set, the bone's transform property is used to set the slider's {@link SliderPose.time}. */ bone: BoneData | null = null; - /** When a bone is set, the specified transform property is used to set the slider's {@link SliderPose#time}. */ + /** When a bone is set, the specified transform property is used to set the slider's {@link SliderPose.time}. */ property!: FromProperty; - /** When a bone is set, this is the scale of the {@link #property} value in relation to the slider time. */ + /** When a bone is set, this is the scale of the {@link property} value in relation to the slider time. */ scale = 0; /** When a bone is set, the offset is added to the property. */ diff --git a/spine-ts/spine-core/src/SliderPose.ts b/spine-ts/spine-core/src/SliderPose.ts index f50ba4af3..21985a246 100644 --- a/spine-ts/spine-core/src/SliderPose.ts +++ b/spine-ts/spine-core/src/SliderPose.ts @@ -28,11 +28,12 @@ *****************************************************************************/ import type { Pose } from "./Pose.js"; +import type { SliderData } from "./SliderData.js"; /** Stores a pose for a slider. */ export class SliderPose implements Pose { - /** The time in the {@link SliderData#animation} to apply the animation. */ + /** The time in the {@link SliderData.animation} to apply the animation. */ time = 0; /** A percentage that controls the mix between the constrained and unconstrained poses. */ diff --git a/spine-ts/spine-core/src/Slot.ts b/spine-ts/spine-core/src/Slot.ts index b5bf4c1be..a44b93fbd 100644 --- a/spine-ts/spine-core/src/Slot.ts +++ b/spine-ts/spine-core/src/Slot.ts @@ -34,8 +34,8 @@ import type { SlotData } from "./SlotData.js"; import { SlotPose } from "./SlotPose.js"; import { Color } from "./Utils.js"; -/** Organizes attachments for {@link Skeleton#drawOrder} purposes and provide a place to store state for an attachment. - *

    +/** Organizes attachments for {@link Skeleton.drawOrder} purposes and provide a place to store state for an attachment. + * * State cannot be stored in an attachment itself because attachments are stateless and may be shared across multiple * skeletons. */ export class Slot extends Posed { diff --git a/spine-ts/spine-core/src/SlotData.ts b/spine-ts/spine-core/src/SlotData.ts index 7d9c20797..26dca8ee0 100644 --- a/spine-ts/spine-core/src/SlotData.ts +++ b/spine-ts/spine-core/src/SlotData.ts @@ -28,6 +28,7 @@ *****************************************************************************/ import type { BoneData } from "./BoneData.js"; +import type { Slot } from "./Slot.js"; import { PosedData } from "./PosedData.js"; import type { Skeleton } from "./Skeleton.js"; import { SlotPose } from "./SlotPose.js"; diff --git a/spine-ts/spine-core/src/SlotPose.ts b/spine-ts/spine-core/src/SlotPose.ts index 9b15c4d6d..132fdba9f 100644 --- a/spine-ts/spine-core/src/SlotPose.ts +++ b/spine-ts/spine-core/src/SlotPose.ts @@ -27,6 +27,7 @@ * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ +import type { DeformTimeline } from "./Animation.js"; import type { Attachment } from "./attachments/Attachment.js"; import { VertexAttachment } from "./attachments/Attachment.js"; import type { Sequence } from "./attachments/Sequence.js"; @@ -35,7 +36,7 @@ import { Color } from "./Utils.js"; /** Stores a slot's pose. */ export class SlotPose implements Pose { - /** The color used to tint the slot's attachment. If {@link #darkColor} is set, this is used as the light color for two color + /** The color used to tint the slot's attachment. If {@link darkColor} is set, this is used as the light color for two color * tinting. */ readonly color = new Color(1, 1, 1, 1); @@ -47,13 +48,13 @@ export class SlotPose implements Pose { attachment: Attachment | null = null; // Not used in setup pose. /** The index of the texture region to display when the slot's attachment has a {@link Sequence}. -1 represents the - * {@link Sequence.getSetupIndex()}. */ + * {@link Sequence.getSetupIndex}. */ sequenceIndex = 0; /** Values to deform the slot's attachment. For an unweighted mesh, the entries are local positions for each vertex. For a * weighted mesh, the entries are an offset for each vertex which will be added to the mesh's local vertex positions. * - * See {@link VertexAttachment.computeWorldVertices()} and + * See {@link VertexAttachment.computeWorldVertices} and * {@link DeformTimeline}. */ readonly deform = [] as number[]; @@ -75,8 +76,8 @@ export class SlotPose implements Pose { return this.attachment; } - /** Sets the slot's attachment and, if the attachment changed, resets {@link #sequenceIndex} and clears the {@link #deform}. - * The deform is not cleared if the old attachment has the same {@link VertexAttachment.getTimelineAttachment()} as the + /** Sets the slot's attachment and, if the attachment changed, resets {@link sequenceIndex} and clears the {@link deform}. + * The deform is not cleared if the old attachment has the same {@link VertexAttachment.getTimelineAttachment} as the * specified attachment. */ setAttachment (attachment: Attachment | null): void { if (this.attachment === attachment) return; diff --git a/spine-ts/spine-core/src/TransformConstraintData.ts b/spine-ts/spine-core/src/TransformConstraintData.ts index f7bacb567..16c47b00d 100644 --- a/spine-ts/spine-core/src/TransformConstraintData.ts +++ b/spine-ts/spine-core/src/TransformConstraintData.ts @@ -146,7 +146,7 @@ export class TransformConstraintData extends ConstraintData | null = null; /** The vertex positions in the bone's coordinate system. For a non-weighted attachment, the values are `x,y` @@ -73,17 +74,17 @@ export abstract class VertexAttachment extends Attachment { super(name); } - /** Transforms the attachment's local {@link #vertices} to world coordinates. If {@link SlotPose#getDeform()} is not empty, it + /** Transforms the attachment's local {@link vertices} to world coordinates. If {@link SlotPose.getDeform} is not empty, it * is used to deform the vertices. - *

    + * * See World transforms in the Spine * Runtimes Guide. - * @param start The index of the first {@link #vertices} value to transform. Each vertex has 2 values, x and y. - * @param count The number of world vertex values to output. Must be <= {@link #worldVerticesLength} - start. - * @param worldVertices The output world vertices. Must have a length >= offset + count * - * stride / 2. - * @param offset The worldVertices index to begin writing values. - * @param stride The number of worldVertices entries between the value pairs written. */ + * @param start The index of the first {@link vertices} value to transform. Each vertex has 2 values, x and y. + * @param count The number of world vertex values to output. Must be <= {@link worldVerticesLength} - `start`. + * @param worldVertices The output world vertices. Must have a length >= `offset` + `count` * + * `stride` / 2. + * @param offset The `worldVertices` index to begin writing values. + * @param stride The number of `worldVertices` entries between the value pairs written. */ computeWorldVertices (skeleton: Skeleton, slot: Slot, start: number, count: number, worldVertices: NumberArrayLike, offset: number, stride: number) { diff --git a/spine-ts/spine-core/src/attachments/BoundingBoxAttachment.ts b/spine-ts/spine-core/src/attachments/BoundingBoxAttachment.ts index 1fe108a60..bca94ffa3 100644 --- a/spine-ts/spine-core/src/attachments/BoundingBoxAttachment.ts +++ b/spine-ts/spine-core/src/attachments/BoundingBoxAttachment.ts @@ -27,6 +27,7 @@ * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ +import type { SkeletonBounds } from "../SkeletonBounds.js"; import { Color } from "../Utils.js"; import { type Attachment, VertexAttachment } from "./Attachment.js"; diff --git a/spine-ts/spine-core/src/attachments/HasSequence.ts b/spine-ts/spine-core/src/attachments/HasSequence.ts index 42747e294..054b58784 100644 --- a/spine-ts/spine-core/src/attachments/HasSequence.ts +++ b/spine-ts/spine-core/src/attachments/HasSequence.ts @@ -27,6 +27,7 @@ * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ +import type { SlotPose } from "../SlotPose.js"; import type { Color } from "../Utils.js" import type { Sequence } from "./Sequence.js" @@ -39,10 +40,10 @@ export interface HasSequence { /** The base path for the attachment's texture region. */ path?: string; - /** The color the attachment is tinted, to be combined with {@link SlotPose#getColor()}. */ + /** The color the attachment is tinted, to be combined with {@link SlotPose.getColor}. */ color: Color; - /** Calls {@link Sequence#update(HasSequence)} on this attachment's sequence. */ + /** Calls {@link Sequence.update} on this attachment's sequence. */ updateSequence (): void; /** The sequence that provides texture regions, UVs, and vertex offsets for rendering this attachment. */ diff --git a/spine-ts/spine-core/src/attachments/MeshAttachment.ts b/spine-ts/spine-core/src/attachments/MeshAttachment.ts index d832c66f5..54b3f4ce1 100644 --- a/spine-ts/spine-core/src/attachments/MeshAttachment.ts +++ b/spine-ts/spine-core/src/attachments/MeshAttachment.ts @@ -47,7 +47,7 @@ export class MeshAttachment extends VertexAttachment implements HasSequence { /** Triplets of vertex indices which describe the mesh's triangulation. */ triangles: Array = []; - /** The number of entries at the beginning of {@link #vertices} that make up the mesh hull. */ + /** The number of entries at the beginning of {@link vertices} that make up the mesh hull. */ hullLength: number = 0; /** The name of the texture region for this attachment. */ @@ -104,9 +104,9 @@ export class MeshAttachment extends VertexAttachment implements HasSequence { this.sequence.update(this); } - /** The parent mesh if this is a linked mesh, else null. A linked mesh shares the {@link #bones}, {@link #vertices}, - * {@link #regionUVs}, {@link #triangles}, {@link #hullLength}, {@link #edges}, {@link #width}, and {@link #height} with the - * parent mesh, but may have a different {@link #name} or {@link #path}, and therefore a different texture region. */ + /** The parent mesh if this is a linked mesh, else null. A linked mesh shares the {@link bones}, {@link vertices}, + * {@link regionUVs}, {@link triangles}, {@link hullLength}, {@link edges}, {@link width}, and {@link height} with the + * parent mesh, but may have a different {@link name} or {@link path}, and therefore a different texture region. */ getParentMesh () { return this.parentMesh; } @@ -125,7 +125,7 @@ export class MeshAttachment extends VertexAttachment implements HasSequence { } } - /** Returns a new mesh with the {@link #parentMesh} set to this mesh's parent mesh, if any, else to this mesh. **/ + /** Returns a new mesh with the {@link parentMesh} set to this mesh's parent mesh, if any, else to this mesh. **/ newLinkedMesh (): MeshAttachment { const copy = new MeshAttachment(this.name, this.sequence.copy()); copy.timelineAttachment = this.timelineAttachment; @@ -136,7 +136,7 @@ export class MeshAttachment extends VertexAttachment implements HasSequence { return copy; } - /** Computes {@link Sequence#getUVs(int) UVs} for a mesh attachment. + /** Computes {@link Sequence.getUVs | UVs} for a mesh attachment. * @param uvs Output array for the computed UVs, same length as regionUVs. */ static computeUVs (region: TextureRegion | null, regionUVs: NumberArrayLike, uvs: NumberArrayLike): void { if (!region) throw new Error("Region not set."); diff --git a/spine-ts/spine-core/src/attachments/PathAttachment.ts b/spine-ts/spine-core/src/attachments/PathAttachment.ts index a4491b76f..1087c78a1 100644 --- a/spine-ts/spine-core/src/attachments/PathAttachment.ts +++ b/spine-ts/spine-core/src/attachments/PathAttachment.ts @@ -27,6 +27,7 @@ * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ +import type { PathConstraint } from "../PathConstraint.js"; import { Color, Utils } from "../Utils.js"; import { type Attachment, VertexAttachment } from "./Attachment.js"; diff --git a/spine-ts/spine-core/src/attachments/RegionAttachment.ts b/spine-ts/spine-core/src/attachments/RegionAttachment.ts index e9d6ee76f..08466dd89 100644 --- a/spine-ts/spine-core/src/attachments/RegionAttachment.ts +++ b/spine-ts/spine-core/src/attachments/RegionAttachment.ts @@ -90,12 +90,12 @@ export class RegionAttachment extends Attachment implements HasSequence { } /** Transforms the attachment's four vertices to world coordinates. - *

    + * * See World transforms in the Spine * Runtimes Guide. - * @param worldVertices The output world vertices. Must have a length >= offset + 8. - * @param offset The worldVertices index to begin writing values. - * @param stride The number of worldVertices entries between the value pairs written. */ + * @param worldVertices The output world vertices. Must have a length >= `offset` + 8. + * @param offset The `worldVertices` index to begin writing values. + * @param stride The number of `worldVertices` entries between the value pairs written. */ computeWorldVertices (slot: Slot, vertexOffsets: NumberArrayLike, worldVertices: NumberArrayLike, offset: number, stride: number) { const bone = slot.bone.appliedPose; @@ -135,7 +135,7 @@ export class RegionAttachment extends Attachment implements HasSequence { this.sequence.update(this); } - /** Computes {@link Sequence#getUVs(int) UVs} and {@link Sequence#getOffsets(int) offsets} for a region attachment. + /** Computes {@link Sequence.getUVs | UVs} and {@link Sequence.getOffsets | offsets} for a region attachment. * @param uvs Output array for the computed UVs, length of 8. * @param offset Output array for the computed vertex offsets, length of 8. */ static computeUVs (region: TextureRegion | null, x: number, y: number, scaleX: number, scaleY: number, rotation: number, width: number, diff --git a/spine-ts/spine-core/src/attachments/Sequence.ts b/spine-ts/spine-core/src/attachments/Sequence.ts index add30182a..45ca35405 100644 --- a/spine-ts/spine-core/src/attachments/Sequence.ts +++ b/spine-ts/spine-core/src/attachments/Sequence.ts @@ -34,8 +34,8 @@ import type { HasSequence } from "./HasSequence.js"; import { MeshAttachment } from "./MeshAttachment.js"; import { RegionAttachment } from "./RegionAttachment.js"; -/** Holds texture regions, UVs, and vertex offsets for rendering a region or mesh attachment. {@link #regions Regions} must be - * populated and {@link #update(HasSequence)} called before use. */ +/** Holds texture regions, UVs, and vertex offsets for rendering a region or mesh attachment. {@link regions Regions} must be + * populated and {@link update} called before use. */ export class Sequence { private static _nextID = 0; @@ -50,10 +50,10 @@ export class Sequence { /** Returns vertex offsets from the center of a {@link RegionAttachment}. Invalid to call for a {@link MeshAttachment}. */ offsets?: number[][]; - /** The starting number for the numeric {@link #getPath(String, int) path} suffix. */ + /** The starting number for the numeric {@link getPath | path} suffix. */ start = 0; - /** The minimum number of digits in the numeric {@link #getPath(String, int) path} suffix, for zero padding. 0 for no zero + /** The minimum number of digits in the numeric {@link getPath | path} suffix, for zero padding. 0 for no zero * padding. */ digits = 0; @@ -61,8 +61,8 @@ export class Sequence { setupIndex = 0; /** @param count The number of texture regions this sequence will display. - * @param pathSuffix If true, the {@link #getPath(String, int) path} has a numeric suffix. If false, all regions will use the - * same path, so count should be 1. */ + * @param pathSuffix If true, the {@link getPath | path} has a numeric suffix. If false, all regions will use the + * same path, so `count` should be 1. */ constructor (count: number, pathSuffix: boolean) { this.regions = new Array(count); this.pathSuffix = pathSuffix; @@ -119,7 +119,7 @@ export class Sequence { } } - /** Returns the {@link #regions} index for the {@link SlotPose#getSequenceIndex()}. */ + /** Returns the {@link regions} index for the {@link SlotPose.getSequenceIndex}. */ resolveIndex (pose: SlotPose): number { let index = pose.sequenceIndex; if (index === -1) index = this.setupIndex; @@ -127,14 +127,14 @@ export class Sequence { return index; } - /** Returns the UVs for the specified index. {@link #regions Regions} must be populated and {@link #update(HasSequence)} called + /** Returns the UVs for the specified index. {@link regions Regions} must be populated and {@link update} called * before calling this method. */ getUVs (index: number): Float32Array { // biome-ignore lint/style/noNonNullAssertion: uvs are always defined after updateSequence return this.uvs![index] as Float32Array; } - /** Returns true if the {@link #getPath(String, int) path} has a numeric suffix. */ + /** Returns true if the {@link getPath | path} has a numeric suffix. */ hasPathSuffix (): boolean { return this.pathSuffix; } @@ -155,7 +155,7 @@ export class Sequence { } } -/** Controls how {@link Sequence#regions} are displayed over time. */ +/** Controls how {@link Sequence.regions} are displayed over time. */ export enum SequenceMode { hold = 0, once = 1,