@esotericsoftware/spine-core 4.2.116 → 4.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Animation.d.ts +426 -274
- package/dist/Animation.js +1174 -1210
- package/dist/AnimationState.d.ts +246 -201
- package/dist/AnimationState.js +508 -471
- package/dist/AnimationStateData.d.ts +12 -10
- package/dist/AnimationStateData.js +19 -20
- package/dist/AssetManagerBase.d.ts +27 -21
- package/dist/AssetManagerBase.js +67 -43
- package/dist/AtlasAttachmentLoader.d.ts +18 -12
- package/dist/AtlasAttachmentLoader.js +28 -39
- package/dist/Bone.d.ts +15 -109
- package/dist/Bone.js +22 -362
- package/dist/BoneData.d.ts +13 -28
- package/dist/BoneData.js +20 -29
- package/dist/BonePose.d.ts +130 -0
- package/dist/BonePose.js +426 -0
- package/dist/Constraint.d.ts +41 -0
- package/dist/Constraint.js +38 -0
- package/dist/ConstraintData.d.ts +7 -5
- package/dist/ConstraintData.js +5 -9
- package/dist/DrawOrder.d.ts +48 -0
- package/dist/DrawOrder.js +64 -0
- package/dist/Event.d.ts +11 -6
- package/dist/Event.js +10 -5
- package/dist/EventData.d.ts +10 -6
- package/dist/EventData.js +18 -7
- package/dist/IkConstraint.d.ts +22 -28
- package/dist/IkConstraint.js +115 -117
- package/dist/IkConstraintData.d.ts +23 -18
- package/dist/IkConstraintData.js +32 -22
- package/dist/IkConstraintPose.d.ts +49 -0
- package/dist/IkConstraintPose.js +55 -0
- package/dist/PathConstraint.d.ts +18 -22
- package/dist/PathConstraint.js +160 -136
- package/dist/PathConstraintData.d.ts +11 -14
- package/dist/PathConstraintData.js +14 -16
- package/dist/PathConstraintPose.d.ts +43 -0
- package/dist/PathConstraintPose.js +49 -0
- package/dist/Physics.d.ts +39 -0
- package/dist/Physics.js +41 -0
- package/dist/PhysicsConstraint.d.ts +26 -30
- package/dist/PhysicsConstraint.js +102 -94
- package/dist/PhysicsConstraintData.d.ts +22 -12
- package/dist/PhysicsConstraintData.js +23 -12
- package/dist/PhysicsConstraintPose.d.ts +47 -0
- package/dist/PhysicsConstraintPose.js +55 -0
- package/dist/Pose.d.ts +33 -0
- package/dist/Pose.js +30 -0
- package/dist/Posed.d.ts +58 -0
- package/dist/Posed.js +78 -0
- package/dist/PosedActive.d.ts +41 -0
- package/dist/{attachments/HasTextureRegion.js → PosedActive.js} +17 -2
- package/dist/PosedData.d.ts +40 -0
- package/dist/PosedData.js +45 -0
- package/dist/Skeleton.d.ts +110 -99
- package/dist/Skeleton.js +271 -449
- package/dist/SkeletonBinary.d.ts +1 -1
- package/dist/SkeletonBinary.js +644 -466
- package/dist/SkeletonBounds.d.ts +4 -4
- package/dist/SkeletonBounds.js +45 -46
- package/dist/SkeletonClipping.d.ts +26 -22
- package/dist/SkeletonClipping.js +654 -340
- package/dist/SkeletonData.d.ts +18 -35
- package/dist/SkeletonData.js +57 -97
- package/dist/SkeletonJson.d.ts +8 -6
- package/dist/SkeletonJson.js +892 -641
- package/dist/SkeletonRendererCore.d.ts +58 -0
- package/dist/SkeletonRendererCore.js +310 -0
- package/dist/Skin.d.ts +20 -16
- package/dist/Skin.js +58 -53
- package/dist/Slider.d.ts +46 -0
- package/dist/Slider.js +115 -0
- package/dist/SliderData.d.ts +58 -0
- package/dist/SliderData.js +59 -0
- package/dist/SliderPose.d.ts +37 -0
- package/dist/SliderPose.js +40 -0
- package/dist/Slot.d.ts +16 -38
- package/dist/Slot.js +37 -60
- package/dist/SlotData.d.ts +5 -12
- package/dist/SlotData.js +7 -15
- package/dist/SlotPose.d.ts +59 -0
- package/dist/SlotPose.js +81 -0
- package/dist/Texture.d.ts +1 -0
- package/dist/Texture.js +2 -1
- package/dist/TextureAtlas.d.ts +3 -3
- package/dist/TextureAtlas.js +49 -49
- package/dist/TransformConstraint.d.ts +16 -28
- package/dist/TransformConstraint.js +72 -209
- package/dist/TransformConstraintData.d.ts +108 -20
- package/dist/TransformConstraintData.js +274 -24
- package/dist/TransformConstraintPose.d.ts +45 -0
- package/dist/TransformConstraintPose.js +52 -0
- package/dist/Triangulator.d.ts +1 -1
- package/dist/Triangulator.js +91 -107
- package/dist/{Updatable.d.ts → Update.d.ts} +5 -12
- package/dist/Update.js +30 -0
- package/dist/Utils.d.ts +12 -3
- package/dist/Utils.js +78 -37
- package/dist/attachments/Attachment.d.ts +27 -19
- package/dist/attachments/Attachment.js +59 -35
- package/dist/attachments/AttachmentLoader.d.ts +14 -14
- package/dist/attachments/AttachmentLoader.js +1 -1
- package/dist/attachments/BoundingBoxAttachment.d.ts +1 -1
- package/dist/attachments/BoundingBoxAttachment.js +2 -2
- package/dist/attachments/ClippingAttachment.d.ts +10 -3
- package/dist/attachments/ClippingAttachment.js +12 -3
- package/dist/attachments/{HasTextureRegion.d.ts → HasSequence.d.ts} +11 -14
- package/dist/attachments/HasSequence.js +30 -0
- package/dist/attachments/MeshAttachment.d.ts +28 -35
- package/dist/attachments/MeshAttachment.js +85 -97
- package/dist/attachments/PathAttachment.d.ts +3 -3
- package/dist/attachments/PathAttachment.js +6 -6
- package/dist/attachments/PointAttachment.d.ts +11 -6
- package/dist/attachments/PointAttachment.js +8 -3
- package/dist/attachments/RegionAttachment.d.ts +25 -27
- package/dist/attachments/RegionAttachment.js +101 -113
- package/dist/attachments/Sequence.d.ts +31 -6
- package/dist/attachments/Sequence.js +79 -13
- package/dist/esm/spine-core.min.mjs +2 -2
- package/dist/esm/spine-core.mjs +7651 -6090
- package/dist/esm/spine-core.mjs.map +4 -4
- package/dist/iife/spine-core.js +7651 -6090
- package/dist/iife/spine-core.js.map +4 -4
- package/dist/iife/spine-core.min.js +2 -2
- package/dist/index.d.ts +32 -11
- package/dist/index.js +33 -12
- package/dist/polyfills.js +4 -5
- package/package.json +1 -1
- package/dist/Updatable.js +0 -30
package/dist/Animation.d.ts
CHANGED
|
@@ -26,106 +26,176 @@
|
|
|
26
26
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
27
27
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
28
28
|
*****************************************************************************/
|
|
29
|
-
import {
|
|
30
|
-
import { Skeleton } from "./Skeleton.js";
|
|
31
|
-
import { Slot } from "./Slot.js";
|
|
32
|
-
import { StringSet, NumberArrayLike } from "./Utils.js";
|
|
33
|
-
import { Event } from "./Event.js";
|
|
34
|
-
import { HasTextureRegion } from "./attachments/HasTextureRegion.js";
|
|
29
|
+
import type { Attachment, VertexAttachment } from "./attachments/Attachment.js";
|
|
35
30
|
import { SequenceMode } from "./attachments/Sequence.js";
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
|
|
31
|
+
import type { Inherit } from "./BoneData.js";
|
|
32
|
+
import type { BonePose } from "./BonePose.js";
|
|
33
|
+
import type { Event } from "./Event.js";
|
|
34
|
+
import type { PhysicsConstraintData } from "./PhysicsConstraintData.js";
|
|
35
|
+
import type { PhysicsConstraintPose } from "./PhysicsConstraintPose.js";
|
|
36
|
+
import type { Skeleton } from "./Skeleton.js";
|
|
37
|
+
import type { Slot } from "./Slot.js";
|
|
38
|
+
import type { SlotPose } from "./SlotPose.js";
|
|
39
|
+
import { Color, type NumberArrayLike, StringSet } from "./Utils.js";
|
|
40
|
+
/** Stores a list of timelines to animate a skeleton's pose over time.
|
|
41
|
+
*
|
|
42
|
+
* See <a href='https://esotericsoftware.com/spine-applying-animations#Timeline-API'>Applying Animations</a> in the Spine Runtimes
|
|
43
|
+
* Guide. */
|
|
40
44
|
export declare class Animation {
|
|
41
|
-
/** The animation's name,
|
|
42
|
-
|
|
45
|
+
/** The animation's name, unique across all animations in the skeleton.
|
|
46
|
+
*
|
|
47
|
+
* See {@link SkeletonData.findAnimation}. */
|
|
48
|
+
readonly name: string;
|
|
49
|
+
/** The duration of the animation in seconds, which is usually the highest time of all frames in the timelines. The duration is
|
|
50
|
+
* used to know when the animation has completed and, for animations that repeat, when it should loop back to the start. */
|
|
43
51
|
timelines: Array<Timeline>;
|
|
44
|
-
timelineIds: StringSet;
|
|
45
|
-
/**
|
|
52
|
+
readonly timelineIds: StringSet;
|
|
53
|
+
/** {@link Skeleton.getBones} indices that this animation's timelines modify.
|
|
54
|
+
*
|
|
55
|
+
* See {@link BoneTimeline.bones}. */
|
|
56
|
+
readonly bones: Array<number>;
|
|
57
|
+
/** The color of the animation as it was in Spine, or a default color if nonessential data was not exported. */
|
|
58
|
+
readonly color: Color;
|
|
59
|
+
/** The duration of the animation in seconds, which is usually the highest time of all frames in the timeline. The duration is
|
|
60
|
+
* used to know when it has completed and when it should loop back to the start. */
|
|
46
61
|
duration: number;
|
|
47
62
|
constructor(name: string, timelines: Array<Timeline>, duration: number);
|
|
48
63
|
setTimelines(timelines: Array<Timeline>): void;
|
|
49
|
-
|
|
50
|
-
/** Applies all the animation's timelines to the specified skeleton.
|
|
51
|
-
*
|
|
52
|
-
* See Timeline {@link Timeline#apply(Skeleton, float, float, Array, float, MixBlend, MixDirection)}.
|
|
53
|
-
* @param loop If true, the animation repeats after {@link #getDuration()}.
|
|
54
|
-
* @param events May be null to ignore fired events. */
|
|
55
|
-
apply(skeleton: Skeleton, lastTime: number, time: number, loop: boolean, events: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection): void;
|
|
56
|
-
}
|
|
57
|
-
/** Controls how a timeline value is mixed with the setup pose value or current pose value when a timeline's `alpha`
|
|
58
|
-
* < 1.
|
|
59
|
-
*
|
|
60
|
-
* See Timeline {@link Timeline#apply(Skeleton, float, float, Array, float, MixBlend, MixDirection)}. */
|
|
61
|
-
export declare enum MixBlend {
|
|
62
|
-
/** Transitions from the setup value to the timeline value (the current value is not used). Before the first key, the setup
|
|
63
|
-
* value is set. */
|
|
64
|
-
setup = 0,
|
|
65
|
-
/** Transitions from the current value to the timeline value. Before the first key, transitions from the current value to
|
|
66
|
-
* the setup value. Timelines which perform instant transitions, such as {@link DrawOrderTimeline} or
|
|
67
|
-
* {@link AttachmentTimeline}, use the setup value before the first key.
|
|
68
|
-
*
|
|
69
|
-
* `first` is intended for the first animations applied, not for animations layered on top of those. */
|
|
70
|
-
first = 1,
|
|
71
|
-
/** Transitions from the current value to the timeline value. No change is made before the first key (the current value is
|
|
72
|
-
* kept until the first key).
|
|
64
|
+
/** Returns true if this animation contains a timeline with any of the specified property IDs.
|
|
73
65
|
*
|
|
74
|
-
*
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* (the current value is kept until the first key).
|
|
66
|
+
* See {@link Timeline.propertyIds}. */
|
|
67
|
+
hasTimeline(ids: string[]): boolean;
|
|
68
|
+
/** Applies the animation's timelines to the specified skeleton.
|
|
78
69
|
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
70
|
+
* See {@link Timeline.apply} and
|
|
71
|
+
* <a href='https://esotericsoftware.com/spine-applying-animations#Timeline-API'>Applying Animations</a> in the Spine Runtimes
|
|
72
|
+
* Guide.
|
|
73
|
+
* @param skeleton The skeleton the animation is applied to. This provides access to the bones, slots, and other skeleton
|
|
74
|
+
* components the timelines may change.
|
|
75
|
+
* @param lastTime The last time in seconds this animation was applied. Some timelines trigger only at discrete times, in which
|
|
76
|
+
* case all keys are triggered between `lastTime` (exclusive) and `time` (inclusive). Pass -1
|
|
77
|
+
* the first time an animation is applied to ensure frame 0 is triggered.
|
|
78
|
+
* @param time The time in seconds the skeleton is being posed for. Timelines find the frame before and after this time and
|
|
79
|
+
* interpolate between the frame values.
|
|
80
|
+
* @param loop True if `time` beyond the {@link duration} repeats the animation, else the last frame is used.
|
|
81
|
+
* @param events If any events are fired, they are added to this list. Pass null to ignore fired events or if no timelines fire
|
|
82
|
+
* events.
|
|
83
|
+
* @param alpha 0 applies setup or current values (depending on `fromSetup`), 1 uses timeline values, and
|
|
84
|
+
* intermediate values interpolate between them. Adjusting `alpha` over time can mix an animation in or
|
|
85
|
+
* out.
|
|
86
|
+
* @param fromSetup If true, `alpha` transitions between setup and timeline values, setup values are used before the
|
|
87
|
+
* first frame (current values are not used). If false, `alpha` transitions between current and timeline
|
|
88
|
+
* values, no change is made before the first frame.
|
|
89
|
+
* @param add If true, for timelines that support it, their values are added to the setup or current values (depending on
|
|
90
|
+
* `fromSetup`).
|
|
91
|
+
* @param out True when the animation is mixing out, else it is mixing in. Used by timelines that perform instant transitions.
|
|
92
|
+
* @param appliedPose True to modify {@link Posed.appliedPose}, else {@link Posed.pose} is modified. */
|
|
93
|
+
apply(skeleton: Skeleton, lastTime: number, time: number, loop: boolean, events: Array<Event> | null, alpha: number, fromSetup: boolean, add: boolean, out: boolean, appliedPose: boolean): void;
|
|
94
|
+
}
|
|
95
|
+
export declare enum Property {
|
|
96
|
+
rotate = 0,
|
|
97
|
+
x = 1,
|
|
98
|
+
y = 2,
|
|
99
|
+
scaleX = 3,
|
|
100
|
+
scaleY = 4,
|
|
101
|
+
shearX = 5,
|
|
102
|
+
shearY = 6,
|
|
103
|
+
inherit = 7,
|
|
104
|
+
rgb = 8,
|
|
105
|
+
alpha = 9,
|
|
106
|
+
rgb2 = 10,
|
|
107
|
+
attachment = 11,
|
|
108
|
+
deform = 12,
|
|
109
|
+
event = 13,
|
|
110
|
+
drawOrder = 14,
|
|
111
|
+
ikConstraint = 15,
|
|
112
|
+
transformConstraint = 16,
|
|
113
|
+
pathConstraintPosition = 17,
|
|
114
|
+
pathConstraintSpacing = 18,
|
|
115
|
+
pathConstraintMix = 19,
|
|
116
|
+
physicsConstraintInertia = 20,
|
|
117
|
+
physicsConstraintStrength = 21,
|
|
118
|
+
physicsConstraintDamping = 22,
|
|
119
|
+
physicsConstraintMass = 23,
|
|
120
|
+
physicsConstraintWind = 24,
|
|
121
|
+
physicsConstraintGravity = 25,
|
|
122
|
+
physicsConstraintMix = 26,
|
|
123
|
+
physicsConstraintReset = 27,
|
|
124
|
+
sequence = 28,
|
|
125
|
+
sliderTime = 29,
|
|
126
|
+
sliderMix = 30
|
|
127
|
+
}
|
|
128
|
+
/** The base class for all timelines.
|
|
86
129
|
*
|
|
87
|
-
* See
|
|
88
|
-
|
|
89
|
-
mixIn = 0,
|
|
90
|
-
mixOut = 1
|
|
91
|
-
}
|
|
92
|
-
/** The interface for all timelines. */
|
|
130
|
+
* See <a href='https://esotericsoftware.com/spine-applying-animations#Timeline-API'>Applying Animations</a> in the Spine
|
|
131
|
+
* Runtimes Guide. */
|
|
93
132
|
export declare abstract class Timeline {
|
|
94
|
-
propertyIds: string[];
|
|
95
|
-
frames: NumberArrayLike;
|
|
96
|
-
|
|
133
|
+
readonly propertyIds: string[];
|
|
134
|
+
readonly frames: NumberArrayLike;
|
|
135
|
+
/** True if this timeline supports additive blending. */
|
|
136
|
+
additive: boolean;
|
|
137
|
+
/** True if this timeline sets values instantaneously and does not support interpolation between frames. */
|
|
138
|
+
instant: boolean;
|
|
139
|
+
constructor(frameCount: number, ...propertyIds: string[]);
|
|
97
140
|
getPropertyIds(): string[];
|
|
141
|
+
/** The number of values stored per frame. */
|
|
98
142
|
getFrameEntries(): number;
|
|
143
|
+
/** The number of frames in this timeline. */
|
|
99
144
|
getFrameCount(): number;
|
|
145
|
+
/** The duration of the timeline in seconds, which is usually the highest time of all frames in the timeline. */
|
|
100
146
|
getDuration(): number;
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
147
|
+
/** Applies this timeline to the skeleton.
|
|
148
|
+
*
|
|
149
|
+
* See <a href='https://esotericsoftware.com/spine-applying-animations#Timeline-API'>Applying Animations</a> in the Spine
|
|
150
|
+
* Runtimes Guide.
|
|
151
|
+
* @param skeleton The skeleton the timeline is applied to. This provides access to the bones, slots, and other skeleton
|
|
152
|
+
* components the timelines may change.
|
|
153
|
+
* @param lastTime The last time in seconds this timeline was applied. Some timelines trigger only at discrete times, in
|
|
154
|
+
* which case all keys are triggered between `lastTime` (exclusive) and `time` (inclusive).
|
|
155
|
+
* Pass -1 the first time a timeline is applied to ensure frame 0 is triggered.
|
|
156
|
+
* @param time The time in seconds the skeleton is being posed for. Timelines find the frame before and after this time and
|
|
157
|
+
* interpolate between the frame values.
|
|
158
|
+
* @param events If any events are fired, they are added to this list. Pass null to ignore fired events or if no timelines
|
|
159
|
+
* fire events.
|
|
160
|
+
* @param alpha 0 applies setup or current values (depending on `fromSetup`), 1 uses timeline values, and
|
|
161
|
+
* intermediate values interpolate between them. Adjusting `alpha` over time can mix a timeline in or
|
|
162
|
+
* out.
|
|
163
|
+
* @param fromSetup If true, `alpha` transitions between setup and timeline values, setup values are used before
|
|
164
|
+
* the first frame (current values are not used). If false, `alpha` transitions between current and
|
|
165
|
+
* timeline values, no change is made before the first frame.
|
|
166
|
+
* @param add If true, for timelines that support it, their values are added to the setup or current values (depending on
|
|
167
|
+
* `fromSetup`).
|
|
168
|
+
* @param out True when the animation is mixing out, else it is mixing in. Used by timelines that perform instant
|
|
169
|
+
* transitions.
|
|
170
|
+
* @param appliedPose True to modify {@link Posed.appliedPose}, else {@link Posed.pose} is modified. */
|
|
171
|
+
abstract apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event> | null, alpha: number, fromSetup: boolean, add: boolean, out: boolean, appliedPose: boolean): void;
|
|
172
|
+
/** Linear search using the specified stride (default 1).
|
|
173
|
+
* @param time Must be >= the first value in `frames`.
|
|
174
|
+
* @return The index of the first value <= `time`. */
|
|
175
|
+
static search(frames: NumberArrayLike, time: number, step?: number): number;
|
|
176
|
+
}
|
|
177
|
+
/** An interface for timelines that change a slot's properties. */
|
|
109
178
|
export interface SlotTimeline {
|
|
110
|
-
/** The index of the slot in {@link Skeleton
|
|
179
|
+
/** The index of the slot in {@link Skeleton.slots} that will be changed when this timeline is applied. */
|
|
111
180
|
slotIndex: number;
|
|
112
181
|
}
|
|
113
|
-
|
|
182
|
+
export declare function isSlotTimeline(obj: Timeline & Partial<SlotTimeline>): obj is Timeline & SlotTimeline;
|
|
183
|
+
/** The base class for timelines that interpolate between frame values using stepped, linear, or a Bezier curve. */
|
|
114
184
|
export declare abstract class CurveTimeline extends Timeline {
|
|
115
185
|
protected curves: NumberArrayLike;
|
|
116
|
-
constructor(frameCount: number, bezierCount: number, propertyIds: string[]);
|
|
186
|
+
constructor(frameCount: number, bezierCount: number, ...propertyIds: string[]);
|
|
117
187
|
/** Sets the specified key frame to linear interpolation. */
|
|
118
188
|
setLinear(frame: number): void;
|
|
119
189
|
/** Sets the specified key frame to stepped interpolation. */
|
|
120
190
|
setStepped(frame: number): void;
|
|
121
|
-
/** Shrinks the storage for Bezier curves, for use when
|
|
191
|
+
/** Shrinks the storage for Bezier curves, for use when `bezierCount` (specified in the constructor) was larger
|
|
122
192
|
* than the actual number of Bezier curves. */
|
|
123
193
|
shrink(bezierCount: number): void;
|
|
124
194
|
/** Stores the segments for the specified Bezier curve. For timelines that modify multiple values, there may be more than
|
|
125
195
|
* one curve per frame.
|
|
126
|
-
* @param bezier The ordinal of this Bezier curve for this timeline, between 0 and
|
|
196
|
+
* @param bezier The ordinal of this Bezier curve for this timeline, between 0 and `bezierCount - 1` (specified
|
|
127
197
|
* in the constructor), inclusive.
|
|
128
|
-
* @param frame Between 0 and
|
|
198
|
+
* @param frame Between 0 and `frameCount - 1`, inclusive.
|
|
129
199
|
* @param value The index of the value for this frame that this curve is used for.
|
|
130
200
|
* @param time1 The time for the first key.
|
|
131
201
|
* @param value1 The value for the first key.
|
|
@@ -137,149 +207,186 @@ export declare abstract class CurveTimeline extends Timeline {
|
|
|
137
207
|
* @param value2 The value for the second key. */
|
|
138
208
|
setBezier(bezier: number, frame: number, value: number, time1: number, value1: number, cx1: number, cy1: number, cx2: number, cy2: number, time2: number, value2: number): void;
|
|
139
209
|
/** Returns the Bezier interpolated value for the specified time.
|
|
140
|
-
* @param frameIndex The index into {@link
|
|
141
|
-
* @param valueOffset The offset from
|
|
142
|
-
* @param i The index of the Bezier segments. See {@link
|
|
210
|
+
* @param frameIndex The index into {@link frames} for the values of the frame before `time`.
|
|
211
|
+
* @param valueOffset The offset from `frameIndex` to the value this curve is used for.
|
|
212
|
+
* @param i The index of the Bezier segments. See {@link getCurveType}. */
|
|
143
213
|
getBezierValue(time: number, frameIndex: number, valueOffset: number, i: number): number;
|
|
144
214
|
}
|
|
215
|
+
/** The base class for a {@link CurveTimeline} that sets one property with a curve. */
|
|
145
216
|
export declare abstract class CurveTimeline1 extends CurveTimeline {
|
|
146
217
|
constructor(frameCount: number, bezierCount: number, propertyId: string);
|
|
147
218
|
getFrameEntries(): number;
|
|
148
219
|
/** Sets the time and value for the specified frame.
|
|
149
|
-
* @param frame Between 0 and
|
|
220
|
+
* @param frame Between 0 and `frameCount`, inclusive.
|
|
150
221
|
* @param time The frame time in seconds. */
|
|
151
222
|
setFrame(frame: number, time: number, value: number): void;
|
|
152
223
|
/** Returns the interpolated value for the specified time. */
|
|
153
224
|
getCurveValue(time: number): number;
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
/**
|
|
225
|
+
/** Returns the interpolated value for properties relative to the setup value. The timeline value is added to the setup
|
|
226
|
+
* value, rather than replacing it.
|
|
227
|
+
*
|
|
228
|
+
* See {@link Timeline.apply}.
|
|
229
|
+
* @param current The current value for the property.
|
|
230
|
+
* @param setup The setup value for the property. */
|
|
231
|
+
getRelativeValue(time: number, alpha: number, fromSetup: boolean, add: boolean, current: number, setup: number): number;
|
|
232
|
+
/** Returns the interpolated value for properties set as absolute values. The timeline value replaces the setup value,
|
|
233
|
+
* rather than being relative to it.
|
|
234
|
+
*
|
|
235
|
+
* See {@link Timeline.apply}.
|
|
236
|
+
* @param current The current value for the property.
|
|
237
|
+
* @param setup The setup value for the property. */
|
|
238
|
+
getAbsoluteValue(time: number, alpha: number, fromSetup: boolean, add: boolean, current: number, setup: number): number;
|
|
239
|
+
/** Returns the interpolated value for properties set as absolute values, using the specified timeline value rather than
|
|
240
|
+
* calling {@link getCurveValue}.
|
|
241
|
+
*
|
|
242
|
+
* See {@link Timeline.apply}.
|
|
243
|
+
* @param current The current value for the property.
|
|
244
|
+
* @param setup The setup value for the property.
|
|
245
|
+
* @param value The timeline value to apply. */
|
|
246
|
+
getAbsoluteValue(time: number, alpha: number, fromSetup: boolean, add: boolean, current: number, setup: number, value: number): number;
|
|
247
|
+
private getAbsoluteValue1;
|
|
248
|
+
private getAbsoluteValue2;
|
|
249
|
+
/** Returns the interpolated value for scale properties. The timeline and setup values are multiplied and sign adjusted.
|
|
250
|
+
*
|
|
251
|
+
* See {@link Timeline.apply}.
|
|
252
|
+
* @param current The current value for the property.
|
|
253
|
+
* @param setup The setup value for the property. */
|
|
254
|
+
getScaleValue(time: number, alpha: number, fromSetup: boolean, add: boolean, out: boolean, current: number, setup: number): number;
|
|
255
|
+
}
|
|
256
|
+
/** An interface for timelines that change a bone's properties. */
|
|
257
|
+
export interface BoneTimeline {
|
|
258
|
+
/** The index of the bone in {@link Skeleton.bones} that is changed by this timeline. */
|
|
259
|
+
boneIndex: number;
|
|
260
|
+
}
|
|
261
|
+
export declare function isBoneTimeline(obj: Timeline & Partial<BoneTimeline>): obj is Timeline & BoneTimeline;
|
|
262
|
+
/** The base class for timelines that change 1 bone property with a curve. */
|
|
263
|
+
export declare abstract class BoneTimeline1 extends CurveTimeline1 implements BoneTimeline {
|
|
264
|
+
readonly boneIndex: number;
|
|
265
|
+
constructor(frameCount: number, bezierCount: number, boneIndex: number, property: Property);
|
|
266
|
+
apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event> | null, alpha: number, fromSetup: boolean, add: boolean, out: boolean, appliedPose: boolean): void;
|
|
267
|
+
protected abstract apply1(pose: BonePose, setup: BonePose, time: number, alpha: number, fromSetup: boolean, add: boolean, out: boolean): void;
|
|
268
|
+
}
|
|
269
|
+
/** The base class for timelines that change two bone properties with a curve. */
|
|
270
|
+
export declare abstract class BoneTimeline2 extends CurveTimeline implements BoneTimeline {
|
|
271
|
+
readonly boneIndex: number;
|
|
272
|
+
/** @param bezierCount The maximum number of Bezier curves. See {@link shrink}.
|
|
162
273
|
* @param propertyIds Unique identifiers for the properties the timeline modifies. */
|
|
163
|
-
constructor(frameCount: number, bezierCount: number,
|
|
274
|
+
constructor(frameCount: number, bezierCount: number, boneIndex: number, property1: Property, property2: Property);
|
|
164
275
|
getFrameEntries(): number;
|
|
165
276
|
/** Sets the time and values for the specified frame.
|
|
166
|
-
* @param frame Between 0 and
|
|
277
|
+
* @param frame Between 0 and `frameCount`, inclusive.
|
|
167
278
|
* @param time The frame time in seconds. */
|
|
168
279
|
setFrame(frame: number, time: number, value1: number, value2: number): void;
|
|
280
|
+
apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event> | null, alpha: number, fromSetup: boolean, add: boolean, out: boolean, appliedPose: boolean): void;
|
|
281
|
+
protected abstract apply1(pose: BonePose, setup: BonePose, time: number, alpha: number, fromSetup: boolean, add: boolean, out: boolean): void;
|
|
169
282
|
}
|
|
170
|
-
/** Changes
|
|
171
|
-
export declare class RotateTimeline extends
|
|
172
|
-
boneIndex: number;
|
|
283
|
+
/** Changes {@link BonePose.rotation}. */
|
|
284
|
+
export declare class RotateTimeline extends BoneTimeline1 {
|
|
173
285
|
constructor(frameCount: number, bezierCount: number, boneIndex: number);
|
|
174
|
-
|
|
286
|
+
apply1(pose: BonePose, setup: BonePose, time: number, alpha: number, fromSetup: boolean, add: boolean, out: boolean): void;
|
|
175
287
|
}
|
|
176
|
-
/** Changes
|
|
177
|
-
export declare class TranslateTimeline extends
|
|
178
|
-
boneIndex: number;
|
|
288
|
+
/** Changes {@link BonePose.x} and {@link BonePose.y}. */
|
|
289
|
+
export declare class TranslateTimeline extends BoneTimeline2 {
|
|
179
290
|
constructor(frameCount: number, bezierCount: number, boneIndex: number);
|
|
180
|
-
|
|
291
|
+
apply1(pose: BonePose, setup: BonePose, time: number, alpha: number, fromSetup: boolean, add: boolean, out: boolean): void;
|
|
181
292
|
}
|
|
182
|
-
/** Changes
|
|
183
|
-
export declare class TranslateXTimeline extends
|
|
184
|
-
boneIndex: number;
|
|
293
|
+
/** Changes {@link BonePose.x}. */
|
|
294
|
+
export declare class TranslateXTimeline extends BoneTimeline1 {
|
|
185
295
|
constructor(frameCount: number, bezierCount: number, boneIndex: number);
|
|
186
|
-
|
|
296
|
+
protected apply1(pose: BonePose, setup: BonePose, time: number, alpha: number, fromSetup: boolean, add: boolean, out: boolean): void;
|
|
187
297
|
}
|
|
188
|
-
/** Changes
|
|
189
|
-
export declare class TranslateYTimeline extends
|
|
190
|
-
boneIndex: number;
|
|
298
|
+
/** Changes {@link BonePose.y}. */
|
|
299
|
+
export declare class TranslateYTimeline extends BoneTimeline1 {
|
|
191
300
|
constructor(frameCount: number, bezierCount: number, boneIndex: number);
|
|
192
|
-
|
|
301
|
+
protected apply1(pose: BonePose, setup: BonePose, time: number, alpha: number, fromSetup: boolean, add: boolean, out: boolean): void;
|
|
193
302
|
}
|
|
194
|
-
/** Changes
|
|
195
|
-
export declare class ScaleTimeline extends
|
|
196
|
-
boneIndex: number;
|
|
303
|
+
/** Changes {@link BonePose.scaleX} and {@link BonePose.scaleY}. */
|
|
304
|
+
export declare class ScaleTimeline extends BoneTimeline2 {
|
|
197
305
|
constructor(frameCount: number, bezierCount: number, boneIndex: number);
|
|
198
|
-
|
|
306
|
+
protected apply1(pose: BonePose, setup: BonePose, time: number, alpha: number, fromSetup: boolean, add: boolean, out: boolean): void;
|
|
199
307
|
}
|
|
200
|
-
/** Changes a
|
|
201
|
-
export declare class ScaleXTimeline extends
|
|
202
|
-
boneIndex: number;
|
|
308
|
+
/** Changes a {@link BonePose.scaleX}. */
|
|
309
|
+
export declare class ScaleXTimeline extends BoneTimeline1 {
|
|
203
310
|
constructor(frameCount: number, bezierCount: number, boneIndex: number);
|
|
204
|
-
|
|
311
|
+
protected apply1(pose: BonePose, setup: BonePose, time: number, alpha: number, fromSetup: boolean, add: boolean, out: boolean): void;
|
|
205
312
|
}
|
|
206
|
-
/** Changes a
|
|
207
|
-
export declare class ScaleYTimeline extends
|
|
208
|
-
boneIndex: number;
|
|
313
|
+
/** Changes a {@link BonePose.scaleY}. */
|
|
314
|
+
export declare class ScaleYTimeline extends BoneTimeline1 {
|
|
209
315
|
constructor(frameCount: number, bezierCount: number, boneIndex: number);
|
|
210
|
-
|
|
316
|
+
protected apply1(pose: BonePose, setup: BonePose, time: number, alpha: number, fromSetup: boolean, add: boolean, out: boolean): void;
|
|
211
317
|
}
|
|
212
|
-
/** Changes
|
|
213
|
-
export declare class ShearTimeline extends
|
|
214
|
-
boneIndex: number;
|
|
318
|
+
/** Changes {@link Bone.shearX} and {@link Bone.shearY}. */
|
|
319
|
+
export declare class ShearTimeline extends BoneTimeline2 {
|
|
215
320
|
constructor(frameCount: number, bezierCount: number, boneIndex: number);
|
|
216
|
-
|
|
321
|
+
protected apply1(pose: BonePose, setup: BonePose, time: number, alpha: number, fromSetup: boolean, add: boolean, out: boolean): void;
|
|
217
322
|
}
|
|
218
|
-
/** Changes
|
|
219
|
-
export declare class ShearXTimeline extends
|
|
220
|
-
boneIndex: number;
|
|
323
|
+
/** Changes {@link Bone.shearX} and {@link Bone.shearY}. */
|
|
324
|
+
export declare class ShearXTimeline extends BoneTimeline1 {
|
|
221
325
|
constructor(frameCount: number, bezierCount: number, boneIndex: number);
|
|
222
|
-
|
|
326
|
+
protected apply1(pose: BonePose, setup: BonePose, time: number, alpha: number, fromSetup: boolean, add: boolean, out: boolean): void;
|
|
223
327
|
}
|
|
224
|
-
/** Changes
|
|
225
|
-
export declare class ShearYTimeline extends
|
|
226
|
-
boneIndex: number;
|
|
328
|
+
/** Changes {@link Bone.shearX} and {@link Bone.shearY}. */
|
|
329
|
+
export declare class ShearYTimeline extends BoneTimeline1 {
|
|
227
330
|
constructor(frameCount: number, bezierCount: number, boneIndex: number);
|
|
228
|
-
|
|
331
|
+
protected apply1(pose: BonePose, setup: BonePose, time: number, alpha: number, fromSetup: boolean, add: boolean, out: boolean): void;
|
|
229
332
|
}
|
|
333
|
+
/** Changes {@link BonePose.inherit}. */
|
|
230
334
|
export declare class InheritTimeline extends Timeline implements BoneTimeline {
|
|
231
|
-
boneIndex: number;
|
|
335
|
+
readonly boneIndex: number;
|
|
232
336
|
constructor(frameCount: number, boneIndex: number);
|
|
233
337
|
getFrameEntries(): number;
|
|
234
|
-
/** Sets the transform mode for the specified frame.
|
|
235
|
-
* @param frame Between 0 and
|
|
338
|
+
/** Sets the inherit transform mode for the specified frame.
|
|
339
|
+
* @param frame Between 0 and `frameCount`, inclusive.
|
|
236
340
|
* @param time The frame time in seconds. */
|
|
237
341
|
setFrame(frame: number, time: number, inherit: Inherit): void;
|
|
238
|
-
apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number,
|
|
342
|
+
apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, fromSetup: boolean, add: boolean, out: boolean, appliedPose: boolean): void;
|
|
239
343
|
}
|
|
240
|
-
/**
|
|
241
|
-
export declare class
|
|
242
|
-
slotIndex: number;
|
|
344
|
+
/** The base class for timelines that change any number of slot properties with a curve. */
|
|
345
|
+
export declare abstract class SlotCurveTimeline extends CurveTimeline implements SlotTimeline {
|
|
346
|
+
readonly slotIndex: number;
|
|
347
|
+
constructor(frameCount: number, bezierCount: number, slotIndex: number, ...propertyIds: string[]);
|
|
348
|
+
apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, fromSetup: boolean, add: boolean, out: boolean, appliedPose: boolean): void;
|
|
349
|
+
protected abstract apply1(slot: Slot, pose: SlotPose, time: number, alpha: number, fromSetup: boolean, add: boolean): void;
|
|
350
|
+
}
|
|
351
|
+
/** Changes {@link SlotPose.color}. */
|
|
352
|
+
export declare class RGBATimeline extends SlotCurveTimeline {
|
|
243
353
|
constructor(frameCount: number, bezierCount: number, slotIndex: number);
|
|
244
354
|
getFrameEntries(): number;
|
|
245
355
|
/** Sets the time in seconds, red, green, blue, and alpha for the specified key frame. */
|
|
246
356
|
setFrame(frame: number, time: number, r: number, g: number, b: number, a: number): void;
|
|
247
|
-
|
|
357
|
+
protected apply1(slot: Slot, pose: SlotPose, time: number, alpha: number, fromSetup: boolean, add: boolean): void;
|
|
248
358
|
}
|
|
249
|
-
/** Changes a slot's {@link
|
|
250
|
-
export declare class RGBTimeline extends
|
|
251
|
-
slotIndex: number;
|
|
359
|
+
/** Changes RGB for a slot's {@link SlotPose.color}. */
|
|
360
|
+
export declare class RGBTimeline extends SlotCurveTimeline {
|
|
252
361
|
constructor(frameCount: number, bezierCount: number, slotIndex: number);
|
|
253
362
|
getFrameEntries(): number;
|
|
254
363
|
/** Sets the time in seconds, red, green, blue, and alpha for the specified key frame. */
|
|
255
364
|
setFrame(frame: number, time: number, r: number, g: number, b: number): void;
|
|
256
|
-
|
|
365
|
+
protected apply1(slot: Slot, pose: SlotPose, time: number, alpha: number, fromSetup: boolean, add: boolean): void;
|
|
257
366
|
}
|
|
258
|
-
/** Changes a
|
|
367
|
+
/** Changes alpha for a slot's {@link SlotPose.color}. */
|
|
259
368
|
export declare class AlphaTimeline extends CurveTimeline1 implements SlotTimeline {
|
|
260
369
|
slotIndex: number;
|
|
261
370
|
constructor(frameCount: number, bezierCount: number, slotIndex: number);
|
|
262
|
-
apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number,
|
|
371
|
+
apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, fromSetup: boolean, add: boolean, out: boolean, appliedPose: boolean): void;
|
|
263
372
|
}
|
|
264
|
-
/** Changes
|
|
265
|
-
export declare class RGBA2Timeline extends
|
|
266
|
-
slotIndex: number;
|
|
373
|
+
/** Changes {@link SlotPose.color} and {@link SlotPose.darkColor} for two color tinting. */
|
|
374
|
+
export declare class RGBA2Timeline extends SlotCurveTimeline {
|
|
267
375
|
constructor(frameCount: number, bezierCount: number, slotIndex: number);
|
|
268
376
|
getFrameEntries(): number;
|
|
269
377
|
/** Sets the time in seconds, light, and dark colors for the specified key frame. */
|
|
270
378
|
setFrame(frame: number, time: number, r: number, g: number, b: number, a: number, r2: number, g2: number, b2: number): void;
|
|
271
|
-
|
|
379
|
+
protected apply1(slot: Slot, pose: SlotPose, time: number, alpha: number, fromSetup: boolean, add: boolean): void;
|
|
272
380
|
}
|
|
273
|
-
/** Changes
|
|
274
|
-
export declare class RGB2Timeline extends
|
|
275
|
-
slotIndex: number;
|
|
381
|
+
/** Changes {@link SlotPose.color} and {@link SlotPose.darkColor} for two color tinting. */
|
|
382
|
+
export declare class RGB2Timeline extends SlotCurveTimeline {
|
|
276
383
|
constructor(frameCount: number, bezierCount: number, slotIndex: number);
|
|
277
384
|
getFrameEntries(): number;
|
|
278
385
|
/** Sets the time in seconds, light, and dark colors for the specified key frame. */
|
|
279
386
|
setFrame(frame: number, time: number, r: number, g: number, b: number, r2: number, g2: number, b2: number): void;
|
|
280
|
-
|
|
387
|
+
protected apply1(slot: Slot, pose: SlotPose, time: number, alpha: number, fromSetup: boolean, add: boolean): void;
|
|
281
388
|
}
|
|
282
|
-
/** Changes
|
|
389
|
+
/** Changes {@link SlotPose.ttachment}. */
|
|
283
390
|
export declare class AttachmentTimeline extends Timeline implements SlotTimeline {
|
|
284
391
|
slotIndex: number;
|
|
285
392
|
/** The attachment name for each key frame. May contain null values to clear the attachment. */
|
|
@@ -288,26 +395,54 @@ export declare class AttachmentTimeline extends Timeline implements SlotTimeline
|
|
|
288
395
|
getFrameCount(): number;
|
|
289
396
|
/** Sets the time in seconds and the attachment name for the specified key frame. */
|
|
290
397
|
setFrame(frame: number, time: number, attachmentName: string | null): void;
|
|
291
|
-
apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number,
|
|
292
|
-
setAttachment(skeleton: Skeleton,
|
|
398
|
+
apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, fromSetup: boolean, add: boolean, out: boolean, appliedPose: boolean): void;
|
|
399
|
+
setAttachment(skeleton: Skeleton, pose: SlotPose, attachmentName: string | null): void;
|
|
293
400
|
}
|
|
294
|
-
/** Changes
|
|
401
|
+
/** Changes {@link SlotPose.deform} to deform a {@link VertexAttachment}. */
|
|
295
402
|
export declare class DeformTimeline extends CurveTimeline implements SlotTimeline {
|
|
296
|
-
slotIndex: number;
|
|
297
|
-
/** The attachment that will be deformed.
|
|
298
|
-
|
|
403
|
+
readonly slotIndex: number;
|
|
404
|
+
/** The attachment that will be deformed.
|
|
405
|
+
*
|
|
406
|
+
* See {@link VertexAttachment.getTimelineAttachment}. */
|
|
407
|
+
readonly attachment: VertexAttachment;
|
|
299
408
|
/** The vertices for each key frame. */
|
|
300
409
|
vertices: Array<NumberArrayLike>;
|
|
301
410
|
constructor(frameCount: number, bezierCount: number, slotIndex: number, attachment: VertexAttachment);
|
|
302
411
|
getFrameCount(): number;
|
|
303
|
-
/** Sets the time
|
|
412
|
+
/** Sets the time and vertices for the specified frame.
|
|
413
|
+
* @param frame Between 0 and `frameCount`, inclusive.
|
|
414
|
+
* @param time The frame time in seconds.
|
|
304
415
|
* @param vertices Vertex positions for an unweighted VertexAttachment, or deform offsets if it has weights. */
|
|
305
416
|
setFrame(frame: number, time: number, vertices: NumberArrayLike): void;
|
|
306
417
|
/** @param value1 Ignored (0 is used for a deform timeline).
|
|
307
418
|
* @param value2 Ignored (1 is used for a deform timeline). */
|
|
308
419
|
setBezier(bezier: number, frame: number, value: number, time1: number, value1: number, cx1: number, cy1: number, cx2: number, cy2: number, time2: number, value2: number): void;
|
|
309
420
|
getCurvePercent(time: number, frame: number): number;
|
|
310
|
-
apply(skeleton: Skeleton, lastTime: number, time: number,
|
|
421
|
+
apply(skeleton: Skeleton, lastTime: number, time: number, events: Event[] | null, alpha: number, fromSetup: boolean, add: boolean, out: boolean, appliedPose: boolean): void;
|
|
422
|
+
private applyToSlot;
|
|
423
|
+
private applyBeforeFirst;
|
|
424
|
+
}
|
|
425
|
+
/** Changes {@link Slot.getSequenceIndex} for an attachment's {@link Sequence}. */
|
|
426
|
+
export declare class SequenceTimeline extends Timeline implements SlotTimeline {
|
|
427
|
+
static ENTRIES: number;
|
|
428
|
+
static MODE: number;
|
|
429
|
+
static DELAY: number;
|
|
430
|
+
readonly slotIndex: number;
|
|
431
|
+
readonly attachment: Attachment;
|
|
432
|
+
constructor(frameCount: number, slotIndex: number, attachment: Attachment);
|
|
433
|
+
getFrameEntries(): number;
|
|
434
|
+
getSlotIndex(): number;
|
|
435
|
+
/** The attachment for which the {@link SlotPose.sequenceIndex} will be set.
|
|
436
|
+
*
|
|
437
|
+
* See {@link VertexAttachment.timelineAttachment}. */
|
|
438
|
+
getAttachment(): Attachment;
|
|
439
|
+
/** Sets the time, mode, index, and frame time for the specified frame.
|
|
440
|
+
* @param frame Between 0 and `frameCount`, inclusive.
|
|
441
|
+
* @param time Seconds between frames. */
|
|
442
|
+
setFrame(frame: number, time: number, mode: SequenceMode, index: number, delay: number): void;
|
|
443
|
+
apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, fromSetup: boolean, add: boolean, out: boolean, appliedPose: boolean): void;
|
|
444
|
+
private setupPose;
|
|
445
|
+
private applyToSlot;
|
|
311
446
|
}
|
|
312
447
|
/** Fires an {@link Event} when specific animation times are reached. */
|
|
313
448
|
export declare class EventTimeline extends Timeline {
|
|
@@ -319,168 +454,185 @@ export declare class EventTimeline extends Timeline {
|
|
|
319
454
|
/** Sets the time in seconds and the event for the specified key frame. */
|
|
320
455
|
setFrame(frame: number, event: Event): void;
|
|
321
456
|
/** Fires events for frames > `lastTime` and <= `time`. */
|
|
322
|
-
apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number,
|
|
457
|
+
apply(skeleton: Skeleton | null, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, fromSetup: boolean, add: boolean, out: boolean, appliedPose: boolean): void;
|
|
323
458
|
}
|
|
324
|
-
/** Changes
|
|
459
|
+
/** Changes the {@link Skeleton.getDrawOrder}. */
|
|
325
460
|
export declare class DrawOrderTimeline extends Timeline {
|
|
461
|
+
static readonly propertyID = "14";
|
|
326
462
|
static propertyIds: string[];
|
|
327
|
-
/** The draw order for each key frame. See {@link
|
|
328
|
-
|
|
463
|
+
/** The draw order for each key frame. See {@link setFrame}. */
|
|
464
|
+
private readonly drawOrders;
|
|
329
465
|
constructor(frameCount: number);
|
|
330
466
|
getFrameCount(): number;
|
|
331
467
|
/** Sets the time in seconds and the draw order for the specified key frame.
|
|
332
|
-
* @param drawOrder
|
|
468
|
+
* @param drawOrder Ordered {@link Skeleton.slots} indices, or null to use setup pose
|
|
333
469
|
* draw order. */
|
|
334
470
|
setFrame(frame: number, time: number, drawOrder: Array<number> | null): void;
|
|
335
|
-
apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number,
|
|
336
|
-
}
|
|
337
|
-
/** Changes
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
471
|
+
apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, fromSetup: boolean, add: boolean, out: boolean, appliedPose: boolean): void;
|
|
472
|
+
}
|
|
473
|
+
/** Changes a subset of the {@link Skeleton.getDrawOrder | draw order}. */
|
|
474
|
+
export declare class DrawOrderFolderTimeline extends Timeline {
|
|
475
|
+
private readonly slots;
|
|
476
|
+
private readonly inFolder;
|
|
477
|
+
private readonly drawOrders;
|
|
478
|
+
/** @param slots {@link Skeleton.slots} indices controlled by this timeline, in setup order.
|
|
479
|
+
* @param slotCount The maximum number of slots in the skeleton. */
|
|
480
|
+
constructor(frameCount: number, slots: number[], slotCount: number);
|
|
481
|
+
private static propertyIds;
|
|
482
|
+
getFrameCount(): number;
|
|
483
|
+
/** The {@link Skeleton.getSlots} indices that this timeline affects, in setup order. */
|
|
484
|
+
getSlots(): number[];
|
|
485
|
+
/** The draw order for each frame. See {@link setFrame}. */
|
|
486
|
+
getDrawOrders(): Array<Array<number> | null>;
|
|
487
|
+
/** Sets the time and draw order for the specified frame.
|
|
488
|
+
* @param frame Between 0 and `frameCount`, inclusive.
|
|
489
|
+
* @param time The frame time in seconds.
|
|
490
|
+
* @param drawOrder Ordered {@link getSlots} indices, or null to use setup pose order. */
|
|
491
|
+
setFrame(frame: number, time: number, drawOrder: Array<number> | null): void;
|
|
492
|
+
apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, fromSetup: boolean, add: boolean, out: boolean, appliedPose: boolean): void;
|
|
493
|
+
private setup;
|
|
494
|
+
}
|
|
495
|
+
export interface ConstraintTimeline {
|
|
496
|
+
/** The index of the constraint in {@link Skeleton.constraints} that will be changed when this timeline is applied, or -1 if
|
|
497
|
+
* a specific constraint will not be changed. */
|
|
498
|
+
readonly constraintIndex: number;
|
|
499
|
+
}
|
|
500
|
+
export declare function isConstraintTimeline(obj: Timeline & Partial<ConstraintTimeline>): obj is Timeline & ConstraintTimeline;
|
|
501
|
+
/** Changes {@link IkConstraintPose.mix)}, {@link IkConstraintPose.softness},
|
|
502
|
+
* {@link IkConstraintPose.bendDirection}, {@link IkConstraintPose.stretch}, and
|
|
503
|
+
* {@link IkConstraintPose.compress}. */
|
|
504
|
+
export declare class IkConstraintTimeline extends CurveTimeline implements ConstraintTimeline {
|
|
505
|
+
readonly constraintIndex: number;
|
|
506
|
+
constructor(frameCount: number, bezierCount: number, constraintIndex: number);
|
|
343
507
|
getFrameEntries(): number;
|
|
344
|
-
/** Sets the time
|
|
508
|
+
/** Sets the time, mix, softness, bend direction, compress, and stretch for the specified frame.
|
|
509
|
+
* @param frame Between 0 and `frameCount`, inclusive.
|
|
510
|
+
* @param time The frame time in seconds.
|
|
511
|
+
* @param bendDirection 1 or -1. */
|
|
345
512
|
setFrame(frame: number, time: number, mix: number, softness: number, bendDirection: number, compress: boolean, stretch: boolean): void;
|
|
346
|
-
apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number,
|
|
513
|
+
apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, fromSetup: boolean, add: boolean, out: boolean, appliedPose: boolean): void;
|
|
347
514
|
}
|
|
348
|
-
/** Changes
|
|
349
|
-
* {@link
|
|
350
|
-
|
|
351
|
-
|
|
515
|
+
/** Changes {@link TransformConstraintPose.mixRotate}, {@link TransformConstraintPose.mixX},
|
|
516
|
+
* {@link TransformConstraintPose.mixY}, {@link TransformConstraintPose.mixScaleX},
|
|
517
|
+
* {@link TransformConstraintPose.mixScaleY}, and {@link TransformConstraintPose.mixShearY}. */
|
|
518
|
+
export declare class TransformConstraintTimeline extends CurveTimeline implements ConstraintTimeline {
|
|
519
|
+
/** The index of the transform constraint slot in {@link Skeleton.transformConstraints} that will be changed. */
|
|
352
520
|
constraintIndex: number;
|
|
353
|
-
constructor(frameCount: number, bezierCount: number,
|
|
521
|
+
constructor(frameCount: number, bezierCount: number, constraintIndex: number);
|
|
354
522
|
getFrameEntries(): number;
|
|
355
|
-
/**
|
|
523
|
+
/** Sets the time, rotate mix, translate mix, scale mix, and shear mix for the specified frame.
|
|
524
|
+
* @param frame Between 0 and `frameCount`, inclusive.
|
|
525
|
+
* @param time The frame time in seconds. */
|
|
356
526
|
setFrame(frame: number, time: number, mixRotate: number, mixX: number, mixY: number, mixScaleX: number, mixScaleY: number, mixShearY: number): void;
|
|
357
|
-
apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number,
|
|
358
|
-
}
|
|
359
|
-
/**
|
|
360
|
-
export declare class
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
constraintIndex: number;
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
* applied. */
|
|
380
|
-
constraintIndex: number;
|
|
381
|
-
constructor(frameCount: number, bezierCount: number, pathConstraintIndex: number);
|
|
527
|
+
apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, fromSetup: boolean, add: boolean, out: boolean, appliedPose: boolean): void;
|
|
528
|
+
}
|
|
529
|
+
/** The base class for timelines that change 1 constraint property with a curve. */
|
|
530
|
+
export declare abstract class ConstraintTimeline1 extends CurveTimeline1 implements ConstraintTimeline {
|
|
531
|
+
readonly constraintIndex: number;
|
|
532
|
+
constructor(frameCount: number, bezierCount: number, constraintIndex: number, property: Property);
|
|
533
|
+
}
|
|
534
|
+
/** Changes {@link PathConstraintPose.position}. */
|
|
535
|
+
export declare class PathConstraintPositionTimeline extends ConstraintTimeline1 {
|
|
536
|
+
constructor(frameCount: number, bezierCount: number, constraintIndex: number);
|
|
537
|
+
apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, fromSetup: boolean, add: boolean, out: boolean, appliedPose: boolean): void;
|
|
538
|
+
}
|
|
539
|
+
/** Changes {@link PathConstraintPose.spacing}. */
|
|
540
|
+
export declare class PathConstraintSpacingTimeline extends ConstraintTimeline1 {
|
|
541
|
+
constructor(frameCount: number, bezierCount: number, constraintIndex: number);
|
|
542
|
+
apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, fromSetup: boolean, add: boolean, out: boolean, appliedPose: boolean): void;
|
|
543
|
+
}
|
|
544
|
+
/** Changes {@link PathConstraint.mixRotate}, {@link PathConstraint.mixX}, and
|
|
545
|
+
* {@link PathConstraint.mixY}. */
|
|
546
|
+
export declare class PathConstraintMixTimeline extends CurveTimeline implements ConstraintTimeline {
|
|
547
|
+
readonly constraintIndex: number;
|
|
548
|
+
constructor(frameCount: number, bezierCount: number, constraintIndex: number);
|
|
382
549
|
getFrameEntries(): number;
|
|
550
|
+
/** Sets the time and color for the specified frame.
|
|
551
|
+
* @param frame Between 0 and `frameCount`, inclusive.
|
|
552
|
+
* @param time The frame time in seconds. */
|
|
383
553
|
setFrame(frame: number, time: number, mixRotate: number, mixX: number, mixY: number): void;
|
|
384
|
-
apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number,
|
|
554
|
+
apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, fromSetup: boolean, add: boolean, out: boolean, appliedPose: boolean): void;
|
|
385
555
|
}
|
|
386
556
|
/** The base class for most {@link PhysicsConstraint} timelines. */
|
|
387
|
-
export declare abstract class PhysicsConstraintTimeline extends
|
|
388
|
-
/**
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection): void;
|
|
394
|
-
abstract setup(constraint: PhysicsConstraint): number;
|
|
395
|
-
abstract get(constraint: PhysicsConstraint): number;
|
|
396
|
-
abstract set(constraint: PhysicsConstraint, value: number): void;
|
|
557
|
+
export declare abstract class PhysicsConstraintTimeline extends ConstraintTimeline1 {
|
|
558
|
+
/** @param constraintIndex -1 for all physics constraints in the skeleton. */
|
|
559
|
+
constructor(frameCount: number, bezierCount: number, constraintIndex: number, property: number);
|
|
560
|
+
apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, fromSetup: boolean, add: boolean, out: boolean, appliedPose: boolean): void;
|
|
561
|
+
abstract get(pose: PhysicsConstraintPose): number;
|
|
562
|
+
abstract set(pose: PhysicsConstraintPose, value: number): void;
|
|
397
563
|
abstract global(constraint: PhysicsConstraintData): boolean;
|
|
398
564
|
}
|
|
399
|
-
/** Changes
|
|
565
|
+
/** Changes {@link PhysicsConstraintPose.inertia}. */
|
|
400
566
|
export declare class PhysicsConstraintInertiaTimeline extends PhysicsConstraintTimeline {
|
|
401
|
-
constructor(frameCount: number, bezierCount: number,
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
set(constraint: PhysicsConstraint, value: number): void;
|
|
567
|
+
constructor(frameCount: number, bezierCount: number, constraintIndex: number);
|
|
568
|
+
get(pose: PhysicsConstraintPose): number;
|
|
569
|
+
set(pose: PhysicsConstraintPose, value: number): void;
|
|
405
570
|
global(constraint: PhysicsConstraintData): boolean;
|
|
406
571
|
}
|
|
407
|
-
/** Changes
|
|
572
|
+
/** Changes {@link PhysicsConstraintPose.strength}. */
|
|
408
573
|
export declare class PhysicsConstraintStrengthTimeline extends PhysicsConstraintTimeline {
|
|
409
|
-
constructor(frameCount: number, bezierCount: number,
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
set(constraint: PhysicsConstraint, value: number): void;
|
|
574
|
+
constructor(frameCount: number, bezierCount: number, constraintIndex: number);
|
|
575
|
+
get(pose: PhysicsConstraintPose): number;
|
|
576
|
+
set(pose: PhysicsConstraintPose, value: number): void;
|
|
413
577
|
global(constraint: PhysicsConstraintData): boolean;
|
|
414
578
|
}
|
|
415
|
-
/** Changes
|
|
579
|
+
/** Changes {@link PhysicsConstraintPose.damping}. */
|
|
416
580
|
export declare class PhysicsConstraintDampingTimeline extends PhysicsConstraintTimeline {
|
|
417
|
-
constructor(frameCount: number, bezierCount: number,
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
set(constraint: PhysicsConstraint, value: number): void;
|
|
581
|
+
constructor(frameCount: number, bezierCount: number, constraintIndex: number);
|
|
582
|
+
get(pose: PhysicsConstraintPose): number;
|
|
583
|
+
set(pose: PhysicsConstraintPose, value: number): void;
|
|
421
584
|
global(constraint: PhysicsConstraintData): boolean;
|
|
422
585
|
}
|
|
423
|
-
/** Changes
|
|
586
|
+
/** Changes {@link PhysicsConstraintPose.massInverse}. The timeline values are not inverted. */
|
|
424
587
|
export declare class PhysicsConstraintMassTimeline extends PhysicsConstraintTimeline {
|
|
425
|
-
constructor(frameCount: number, bezierCount: number,
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
set(constraint: PhysicsConstraint, value: number): void;
|
|
588
|
+
constructor(frameCount: number, bezierCount: number, constraintIndex: number);
|
|
589
|
+
get(pose: PhysicsConstraintPose): number;
|
|
590
|
+
set(pose: PhysicsConstraintPose, value: number): void;
|
|
429
591
|
global(constraint: PhysicsConstraintData): boolean;
|
|
430
592
|
}
|
|
431
|
-
/** Changes
|
|
593
|
+
/** Changes {@link PhysicsConstraintPose.wind}. */
|
|
432
594
|
export declare class PhysicsConstraintWindTimeline extends PhysicsConstraintTimeline {
|
|
433
|
-
constructor(frameCount: number, bezierCount: number,
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
set(constraint: PhysicsConstraint, value: number): void;
|
|
595
|
+
constructor(frameCount: number, bezierCount: number, constraintIndex: number);
|
|
596
|
+
get(pose: PhysicsConstraintPose): number;
|
|
597
|
+
set(pose: PhysicsConstraintPose, value: number): void;
|
|
437
598
|
global(constraint: PhysicsConstraintData): boolean;
|
|
438
599
|
}
|
|
439
|
-
/** Changes
|
|
600
|
+
/** Changes {@link PhysicsConstraintPose.gravity}. */
|
|
440
601
|
export declare class PhysicsConstraintGravityTimeline extends PhysicsConstraintTimeline {
|
|
441
|
-
constructor(frameCount: number, bezierCount: number,
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
set(constraint: PhysicsConstraint, value: number): void;
|
|
602
|
+
constructor(frameCount: number, bezierCount: number, constraintIndex: number);
|
|
603
|
+
get(pose: PhysicsConstraintPose): number;
|
|
604
|
+
set(pose: PhysicsConstraintPose, value: number): void;
|
|
445
605
|
global(constraint: PhysicsConstraintData): boolean;
|
|
446
606
|
}
|
|
447
|
-
/** Changes
|
|
607
|
+
/** Changes {@link PhysicsConstraintPose.mix}. */
|
|
448
608
|
export declare class PhysicsConstraintMixTimeline extends PhysicsConstraintTimeline {
|
|
449
|
-
constructor(frameCount: number, bezierCount: number,
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
set(constraint: PhysicsConstraint, value: number): void;
|
|
609
|
+
constructor(frameCount: number, bezierCount: number, constraintIndex: number);
|
|
610
|
+
get(pose: PhysicsConstraintPose): number;
|
|
611
|
+
set(pose: PhysicsConstraintPose, value: number): void;
|
|
453
612
|
global(constraint: PhysicsConstraintData): boolean;
|
|
454
613
|
}
|
|
455
614
|
/** Resets a physics constraint when specific animation times are reached. */
|
|
456
|
-
export declare class PhysicsConstraintResetTimeline extends Timeline {
|
|
615
|
+
export declare class PhysicsConstraintResetTimeline extends Timeline implements ConstraintTimeline {
|
|
457
616
|
private static propertyIds;
|
|
458
|
-
/** The index of the physics constraint in {@link Skeleton
|
|
617
|
+
/** The index of the physics constraint in {@link Skeleton.contraints} that will be reset when this timeline is
|
|
459
618
|
* applied, or -1 if all physics constraints in the skeleton will be reset. */
|
|
460
|
-
constraintIndex: number;
|
|
461
|
-
/** @param
|
|
462
|
-
constructor(frameCount: number,
|
|
619
|
+
readonly constraintIndex: number;
|
|
620
|
+
/** @param constraintIndex -1 for all physics constraints in the skeleton. */
|
|
621
|
+
constructor(frameCount: number, constraintIndex: number);
|
|
463
622
|
getFrameCount(): number;
|
|
464
623
|
/** Sets the time for the specified frame.
|
|
465
|
-
* @param frame Between 0 and
|
|
624
|
+
* @param frame Between 0 and `frameCount`, inclusive. */
|
|
466
625
|
setFrame(frame: number, time: number): void;
|
|
467
|
-
/** Resets the physics constraint when frames >
|
|
468
|
-
apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number,
|
|
469
|
-
}
|
|
470
|
-
/** Changes
|
|
471
|
-
export declare class
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
constructor(frameCount: number,
|
|
478
|
-
|
|
479
|
-
getSlotIndex(): number;
|
|
480
|
-
getAttachment(): Attachment;
|
|
481
|
-
/** Sets the time, mode, index, and frame time for the specified frame.
|
|
482
|
-
* @param frame Between 0 and <code>frameCount</code>, inclusive.
|
|
483
|
-
* @param time Seconds between frames. */
|
|
484
|
-
setFrame(frame: number, time: number, mode: SequenceMode, index: number, delay: number): void;
|
|
485
|
-
apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection): void;
|
|
626
|
+
/** Resets the physics constraint when frames > `lastTime` and <= `time`. */
|
|
627
|
+
apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, fromSetup: boolean, add: boolean, out: boolean, appliedPose: boolean): void;
|
|
628
|
+
}
|
|
629
|
+
/** Changes {@link SliderPose.time}. */
|
|
630
|
+
export declare class SliderTimeline extends ConstraintTimeline1 {
|
|
631
|
+
constructor(frameCount: number, bezierCount: number, constraintIndex: number);
|
|
632
|
+
apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, fromSetup: boolean, add: boolean, out: boolean, appliedPose: boolean): void;
|
|
633
|
+
}
|
|
634
|
+
/** Changes {@link SliderPose.mix}. */
|
|
635
|
+
export declare class SliderMixTimeline extends ConstraintTimeline1 {
|
|
636
|
+
constructor(frameCount: number, bezierCount: number, constraintIndex: number);
|
|
637
|
+
apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, fromSetup: boolean, add: boolean, out: boolean, appliedPose: boolean): void;
|
|
486
638
|
}
|