@galacean/effects-plugin-spine 0.0.1-alpha.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/README.md +116 -0
- package/dist/core/Animation.d.ts +362 -0
- package/dist/core/AnimationState.d.ts +370 -0
- package/dist/core/AnimationStateData.d.ts +23 -0
- package/dist/core/AtlasAttachmentLoader.d.ts +25 -0
- package/dist/core/Bone.d.ts +110 -0
- package/dist/core/BoneData.d.ts +44 -0
- package/dist/core/ConstraintData.d.ts +7 -0
- package/dist/core/Event.d.ts +16 -0
- package/dist/core/EventData.d.ts +13 -0
- package/dist/core/IkConstraint.d.ts +36 -0
- package/dist/core/IkConstraintData.d.ts +28 -0
- package/dist/core/PathConstraint.d.ts +43 -0
- package/dist/core/PathConstraintData.d.ts +54 -0
- package/dist/core/Skeleton.d.ts +133 -0
- package/dist/core/SkeletonBinary.d.ts +40 -0
- package/dist/core/SkeletonBounds.d.ts +49 -0
- package/dist/core/SkeletonClipping.d.ts +22 -0
- package/dist/core/SkeletonData.d.ts +86 -0
- package/dist/core/SkeletonJson.d.ts +25 -0
- package/dist/core/Skin.d.ts +43 -0
- package/dist/core/Slot.d.ts +41 -0
- package/dist/core/SlotData.d.ts +29 -0
- package/dist/core/Texture.d.ts +28 -0
- package/dist/core/TextureAtlas.d.ts +39 -0
- package/dist/core/TransformConstraint.d.ts +32 -0
- package/dist/core/TransformConstraintData.d.ts +34 -0
- package/dist/core/Triangulator.d.ts +15 -0
- package/dist/core/Updatable.d.ts +9 -0
- package/dist/core/attachments/Attachment.d.ts +44 -0
- package/dist/core/attachments/AttachmentLoader.d.ts +26 -0
- package/dist/core/attachments/BoundingBoxAttachment.d.ts +13 -0
- package/dist/core/attachments/ClippingAttachment.d.ts +15 -0
- package/dist/core/attachments/HasTextureRegion.d.ts +16 -0
- package/dist/core/attachments/MeshAttachment.d.ts +53 -0
- package/dist/core/attachments/PathAttachment.d.ts +20 -0
- package/dist/core/attachments/PointAttachment.d.ts +22 -0
- package/dist/core/attachments/RegionAttachment.d.ts +84 -0
- package/dist/core/attachments/Sequence.d.ts +27 -0
- package/dist/core/attachments/index.d.ts +8 -0
- package/dist/core/index.d.ts +37 -0
- package/dist/core/polyfills.d.ts +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +11664 -0
- package/dist/index.js.map +1 -0
- package/dist/index.min.js +9 -0
- package/dist/index.min.js.map +1 -0
- package/dist/index.mjs +11574 -0
- package/dist/index.mjs.map +1 -0
- package/dist/math/math.d.ts +30 -0
- package/dist/math/vector2.d.ts +8 -0
- package/dist/slot-group.d.ts +101 -0
- package/dist/spine-loader.d.ts +55 -0
- package/dist/spine-mesh.d.ts +38 -0
- package/dist/spine-vfx-item.d.ts +106 -0
- package/dist/utils.d.ts +115 -0
- package/package.json +44 -0
package/README.md
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# Galacean Effects 骨骼动画插件
|
|
2
|
+
|
|
3
|
+
## 使用
|
|
4
|
+
### React demo (Smallfish)
|
|
5
|
+
https://code.alipay.com/shixian.cr/spine-demo
|
|
6
|
+
|
|
7
|
+
### 简单引入
|
|
8
|
+
|
|
9
|
+
``` ts
|
|
10
|
+
import { Player } from '@galacean/effects';
|
|
11
|
+
import '@galacean/effects-plugin-spine';
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
### 获取 spine 资源列表
|
|
15
|
+
|
|
16
|
+
``` ts
|
|
17
|
+
import type { SpineResource } from '@galacean/effects-plugin-spine';
|
|
18
|
+
|
|
19
|
+
const comp = await player.play(scene);
|
|
20
|
+
const spineData: SpineResource[] = comp.loaderData.spineDatas;
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### 获取动画列表/皮肤列表
|
|
24
|
+
|
|
25
|
+
1. 使用函数获取
|
|
26
|
+
|
|
27
|
+
``` ts
|
|
28
|
+
const comp = await new Player().loadScene(scene);
|
|
29
|
+
const item = comp.getItemByName(name)
|
|
30
|
+
const { skeletonData } = item.spineDataCache;
|
|
31
|
+
const animationList = getAnimationList(skeletonData);
|
|
32
|
+
const skinList = getSkinList(skeletonData);
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
2. 在 `spineDatas` 数组中获取
|
|
36
|
+
|
|
37
|
+
``` ts
|
|
38
|
+
const comp = await new Player().loadScene(scene);
|
|
39
|
+
const { skinList, animationList } = comp.loaderData.spineDatas[index];
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### 获取指定动画时长
|
|
43
|
+
|
|
44
|
+
``` ts
|
|
45
|
+
const animationDuration = getAnimationDuration(skeletonData, animationName);
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### 获取创建纹理的参数
|
|
49
|
+
``` ts
|
|
50
|
+
import { getTextureOptions } from '@galacean/effects-plugin-spine';
|
|
51
|
+
|
|
52
|
+
const { magFilter, minFilter, wrapS, wrapT, pma } = getTextureOptions(atlasBuffer);
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### 设置动画 mix 时间
|
|
56
|
+
|
|
57
|
+
1. 设置动画的默认 mix 时间 (需要在 `player.play`` 前调用)
|
|
58
|
+
|
|
59
|
+
``` ts
|
|
60
|
+
const comp = await new Player().loadScene(scene);
|
|
61
|
+
const item = comp.getItemByName(name);
|
|
62
|
+
|
|
63
|
+
item.setDefaultMixDuration(mix);
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
2. 设置指定动作的 mix 时间 (需要在 `player.play`` 前调用)
|
|
67
|
+
|
|
68
|
+
``` ts
|
|
69
|
+
const comp = await new Player().loadScene(scene);
|
|
70
|
+
const item = comp.getItemByName(name);
|
|
71
|
+
|
|
72
|
+
item.setMixDuration(animationOut, animationIn, mix);
|
|
73
|
+
```
|
|
74
|
+
### 设置播放速度
|
|
75
|
+
|
|
76
|
+
``` ts
|
|
77
|
+
const comp = await new Player().loadScene(scene);
|
|
78
|
+
const item = comp.getItemByName(name);
|
|
79
|
+
|
|
80
|
+
item.setSpeed(speed);
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### 设置动画
|
|
84
|
+
|
|
85
|
+
1. 设置单个动画
|
|
86
|
+
``` ts
|
|
87
|
+
const comp = await new Player().loadScene(scene);
|
|
88
|
+
const item = comp.getItemByName(name);
|
|
89
|
+
|
|
90
|
+
item.setAnimation(animationName, speed);
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
2. 设置一组动画
|
|
94
|
+
|
|
95
|
+
``` ts
|
|
96
|
+
const comp = await new Player().loadScene(scene);
|
|
97
|
+
const item = comp.getItemByName(name);
|
|
98
|
+
const animationList = [animationName1, animationName2, animationName3];
|
|
99
|
+
|
|
100
|
+
item.setAnimation(animationList, speed);
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## 本地开发
|
|
104
|
+
|
|
105
|
+
### 开始开发
|
|
106
|
+
|
|
107
|
+
``` bash
|
|
108
|
+
# demo
|
|
109
|
+
pnpm --filter @galacean/effects-plugin-spine dev
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
> 浏览器打开:http://localhost:8081/demo/
|
|
113
|
+
|
|
114
|
+
## 帧对比测试
|
|
115
|
+
|
|
116
|
+
> 浏览器打开:http://localhost:8081/test/
|
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
import type { Attachment } from './attachments';
|
|
2
|
+
import { VertexAttachment } from './attachments';
|
|
3
|
+
import type { Skeleton } from './Skeleton';
|
|
4
|
+
import type { Slot } from './Slot';
|
|
5
|
+
import type { NumberArrayLike } from '../utils';
|
|
6
|
+
import { StringSet } from '../utils';
|
|
7
|
+
import type { Event } from './Event';
|
|
8
|
+
import type { HasTextureRegion } from './attachments/HasTextureRegion';
|
|
9
|
+
import { SequenceMode } from './attachments/Sequence';
|
|
10
|
+
/** A simple container for a list of timelines and a name. */
|
|
11
|
+
export declare class Animation {
|
|
12
|
+
/** The animation's name, which is unique across all animations in the skeleton. */
|
|
13
|
+
name: string;
|
|
14
|
+
timelines: Array<Timeline>;
|
|
15
|
+
timelineIds: StringSet;
|
|
16
|
+
/** The duration of the animation in seconds, which is the highest time of all keys in the timeline. */
|
|
17
|
+
duration: number;
|
|
18
|
+
constructor(name: string, timelines: Array<Timeline>, duration: number);
|
|
19
|
+
setTimelines(timelines: Array<Timeline>): void;
|
|
20
|
+
hasTimeline(ids: string[]): boolean;
|
|
21
|
+
/** Applies all the animation's timelines to the specified skeleton.
|
|
22
|
+
*
|
|
23
|
+
* See Timeline {@link Timeline#apply(Skeleton, float, float, Array, float, MixBlend, MixDirection)}.
|
|
24
|
+
* @param skeleton
|
|
25
|
+
* @param lastTime
|
|
26
|
+
* @param time
|
|
27
|
+
* @param loop If true, the animation repeats after {@link #getDuration()}.
|
|
28
|
+
* @param alpha
|
|
29
|
+
* @param blend
|
|
30
|
+
* @param direction
|
|
31
|
+
* @param events May be null to ignore fired events. */
|
|
32
|
+
apply(skeleton: Skeleton, lastTime: number, time: number, loop: boolean, events: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection): void;
|
|
33
|
+
}
|
|
34
|
+
/** Controls how a timeline value is mixed with the setup pose value or current pose value when a timeline's `alpha`
|
|
35
|
+
* < 1.
|
|
36
|
+
*
|
|
37
|
+
* See Timeline {@link Timeline#apply(Skeleton, float, float, Array, float, MixBlend, MixDirection)}. */
|
|
38
|
+
export declare enum MixBlend {
|
|
39
|
+
/** Transitions from the setup value to the timeline value (the current value is not used). Before the first key, the setup
|
|
40
|
+
* value is set. */
|
|
41
|
+
setup = 0,
|
|
42
|
+
/** Transitions from the current value to the timeline value. Before the first key, transitions from the current value to
|
|
43
|
+
* the setup value. Timelines which perform instant transitions, such as {@link DrawOrderTimeline} or
|
|
44
|
+
* {@link AttachmentTimeline}, use the setup value before the first key.
|
|
45
|
+
*
|
|
46
|
+
* `first` is intended for the first animations applied, not for animations layered on top of those. */
|
|
47
|
+
first = 1,
|
|
48
|
+
/** Transitions from the current value to the timeline value. No change is made before the first key (the current value is
|
|
49
|
+
* kept until the first key).
|
|
50
|
+
*
|
|
51
|
+
* `replace` is intended for animations layered on top of others, not for the first animations applied. */
|
|
52
|
+
replace = 2,
|
|
53
|
+
/** Transitions from the current value to the current value plus the timeline value. No change is made before the first key
|
|
54
|
+
* (the current value is kept until the first key).
|
|
55
|
+
*
|
|
56
|
+
* `add` is intended for animations layered on top of others, not for the first animations applied. Properties
|
|
57
|
+
* keyed by additive animations must be set manually or by another animation before applying the additive animations, else
|
|
58
|
+
* the property values will increase continually. */
|
|
59
|
+
add = 3
|
|
60
|
+
}
|
|
61
|
+
/** Indicates whether a timeline's `alpha` is mixing out over time toward 0 (the setup or current pose value) or
|
|
62
|
+
* mixing in toward 1 (the timeline's value).
|
|
63
|
+
*
|
|
64
|
+
* See Timeline {@link Timeline#apply(Skeleton, float, float, Array, float, MixBlend, MixDirection)}. */
|
|
65
|
+
export declare enum MixDirection {
|
|
66
|
+
mixIn = 0,
|
|
67
|
+
mixOut = 1
|
|
68
|
+
}
|
|
69
|
+
/** The interface for all timelines. */
|
|
70
|
+
export declare abstract class Timeline {
|
|
71
|
+
propertyIds: string[];
|
|
72
|
+
frames: NumberArrayLike | Array<number>;
|
|
73
|
+
constructor(frameCount: number, propertyIds: string[]);
|
|
74
|
+
getPropertyIds(): string[];
|
|
75
|
+
getFrameEntries(): number;
|
|
76
|
+
getFrameCount(): number;
|
|
77
|
+
getDuration(): number;
|
|
78
|
+
abstract apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event> | null, alpha: number, blend: MixBlend, direction: MixDirection): void;
|
|
79
|
+
static search1(frames: NumberArrayLike | Array<number>, time: number): number;
|
|
80
|
+
static search(frames: NumberArrayLike | Array<number>, time: number, step: number): number;
|
|
81
|
+
}
|
|
82
|
+
export interface BoneTimeline {
|
|
83
|
+
/** The index of the bone in {@link Skeleton#bones} that will be changed. */
|
|
84
|
+
boneIndex: number;
|
|
85
|
+
}
|
|
86
|
+
export interface SlotTimeline {
|
|
87
|
+
/** The index of the slot in {@link Skeleton#slots} that will be changed. */
|
|
88
|
+
slotIndex: number;
|
|
89
|
+
}
|
|
90
|
+
/** The base class for timelines that use interpolation between key frame values. */
|
|
91
|
+
export declare abstract class CurveTimeline extends Timeline {
|
|
92
|
+
protected curves: NumberArrayLike | Array<number>;
|
|
93
|
+
constructor(frameCount: number, bezierCount: number, propertyIds: string[]);
|
|
94
|
+
/** Sets the specified key frame to linear interpolation. */
|
|
95
|
+
setLinear(frame: number): void;
|
|
96
|
+
/** Sets the specified key frame to stepped interpolation. */
|
|
97
|
+
setStepped(frame: number): void;
|
|
98
|
+
/** Shrinks the storage for Bezier curves, for use when <code>bezierCount</code> (specified in the constructor) was larger
|
|
99
|
+
* than the actual number of Bezier curves. */
|
|
100
|
+
shrink(bezierCount: number): void;
|
|
101
|
+
/** Stores the segments for the specified Bezier curve. For timelines that modify multiple values, there may be more than
|
|
102
|
+
* one curve per frame.
|
|
103
|
+
* @param bezier The ordinal of this Bezier curve for this timeline, between 0 and <code>bezierCount - 1</code> (specified
|
|
104
|
+
* in the constructor), inclusive.
|
|
105
|
+
* @param frame Between 0 and <code>frameCount - 1</code>, inclusive.
|
|
106
|
+
* @param value The index of the value for this frame that this curve is used for.
|
|
107
|
+
* @param time1 The time for the first key.
|
|
108
|
+
* @param value1 The value for the first key.
|
|
109
|
+
* @param cx1 The time for the first Bezier handle.
|
|
110
|
+
* @param cy1 The value for the first Bezier handle.
|
|
111
|
+
* @param cx2 The time of the second Bezier handle.
|
|
112
|
+
* @param cy2 The value for the second Bezier handle.
|
|
113
|
+
* @param time2 The time for the second key.
|
|
114
|
+
* @param value2 The value for the second key. */
|
|
115
|
+
setBezier(bezier: number, frame: number, value: number, time1: number, value1: number, cx1: number, cy1: number, cx2: number, cy2: number, time2: number, value2: number): void;
|
|
116
|
+
/** Returns the Bezier interpolated value for the specified time.
|
|
117
|
+
* @param frameIndex The index into {@link #getFrames()} for the values of the frame before <code>time</code>.
|
|
118
|
+
* @param valueOffset The offset from <code>frameIndex</code> to the value this curve is used for.
|
|
119
|
+
* @param i The index of the Bezier segments. See {@link #getCurveType(int)}. */
|
|
120
|
+
getBezierValue(time: number, frameIndex: number, valueOffset: number, i: number): number;
|
|
121
|
+
}
|
|
122
|
+
export declare abstract class CurveTimeline1 extends CurveTimeline {
|
|
123
|
+
constructor(frameCount: number, bezierCount: number, propertyId: string);
|
|
124
|
+
getFrameEntries(): number;
|
|
125
|
+
/** Sets the time and value for the specified frame.
|
|
126
|
+
* @param frame Between 0 and <code>frameCount</code>, inclusive.
|
|
127
|
+
* @param time The frame time in seconds. */
|
|
128
|
+
setFrame(frame: number, time: number, value: number): void;
|
|
129
|
+
/** Returns the interpolated value for the specified time. */
|
|
130
|
+
getCurveValue(time: number): number;
|
|
131
|
+
}
|
|
132
|
+
/** The base class for a {@link CurveTimeline} which sets two properties. */
|
|
133
|
+
export declare abstract class CurveTimeline2 extends CurveTimeline {
|
|
134
|
+
/** @param bezierCount The maximum number of Bezier curves. See {@link #shrink(int)}.
|
|
135
|
+
* @param propertyIds Unique identifiers for the properties the timeline modifies. */
|
|
136
|
+
constructor(frameCount: number, bezierCount: number, propertyId1: string, propertyId2: string);
|
|
137
|
+
getFrameEntries(): number;
|
|
138
|
+
/** Sets the time and values for the specified frame.
|
|
139
|
+
* @param frame Between 0 and <code>frameCount</code>, inclusive.
|
|
140
|
+
* @param time The frame time in seconds. */
|
|
141
|
+
setFrame(frame: number, time: number, value1: number, value2: number): void;
|
|
142
|
+
}
|
|
143
|
+
/** Changes a bone's local {@link Bone#rotation}. */
|
|
144
|
+
export declare class RotateTimeline extends CurveTimeline1 implements BoneTimeline {
|
|
145
|
+
boneIndex: number;
|
|
146
|
+
constructor(frameCount: number, bezierCount: number, boneIndex: number);
|
|
147
|
+
apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event> | null, alpha: number, blend: MixBlend, direction: MixDirection): void;
|
|
148
|
+
}
|
|
149
|
+
/** Changes a bone's local {@link Bone#x} and {@link Bone#y}. */
|
|
150
|
+
export declare class TranslateTimeline extends CurveTimeline2 implements BoneTimeline {
|
|
151
|
+
boneIndex: number;
|
|
152
|
+
constructor(frameCount: number, bezierCount: number, boneIndex: number);
|
|
153
|
+
apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection): void;
|
|
154
|
+
}
|
|
155
|
+
/** Changes a bone's local {@link Bone#x}. */
|
|
156
|
+
export declare class TranslateXTimeline extends CurveTimeline1 implements BoneTimeline {
|
|
157
|
+
boneIndex: number;
|
|
158
|
+
constructor(frameCount: number, bezierCount: number, boneIndex: number);
|
|
159
|
+
apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection): void;
|
|
160
|
+
}
|
|
161
|
+
/** Changes a bone's local {@link Bone#x}. */
|
|
162
|
+
export declare class TranslateYTimeline extends CurveTimeline1 implements BoneTimeline {
|
|
163
|
+
boneIndex: number;
|
|
164
|
+
constructor(frameCount: number, bezierCount: number, boneIndex: number);
|
|
165
|
+
apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection): void;
|
|
166
|
+
}
|
|
167
|
+
/** Changes a bone's local {@link Bone#scaleX)} and {@link Bone#scaleY}. */
|
|
168
|
+
export declare class ScaleTimeline extends CurveTimeline2 implements BoneTimeline {
|
|
169
|
+
boneIndex: number;
|
|
170
|
+
constructor(frameCount: number, bezierCount: number, boneIndex: number);
|
|
171
|
+
apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection): void;
|
|
172
|
+
}
|
|
173
|
+
/** Changes a bone's local {@link Bone#scaleX)} and {@link Bone#scaleY}. */
|
|
174
|
+
export declare class ScaleXTimeline extends CurveTimeline1 implements BoneTimeline {
|
|
175
|
+
boneIndex: number;
|
|
176
|
+
constructor(frameCount: number, bezierCount: number, boneIndex: number);
|
|
177
|
+
apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection): void;
|
|
178
|
+
}
|
|
179
|
+
/** Changes a bone's local {@link Bone#scaleX)} and {@link Bone#scaleY}. */
|
|
180
|
+
export declare class ScaleYTimeline extends CurveTimeline1 implements BoneTimeline {
|
|
181
|
+
boneIndex: number;
|
|
182
|
+
constructor(frameCount: number, bezierCount: number, boneIndex: number);
|
|
183
|
+
apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection): void;
|
|
184
|
+
}
|
|
185
|
+
/** Changes a bone's local {@link Bone#shearX} and {@link Bone#shearY}. */
|
|
186
|
+
export declare class ShearTimeline extends CurveTimeline2 implements BoneTimeline {
|
|
187
|
+
boneIndex: number;
|
|
188
|
+
constructor(frameCount: number, bezierCount: number, boneIndex: number);
|
|
189
|
+
apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection): void;
|
|
190
|
+
}
|
|
191
|
+
/** Changes a bone's local {@link Bone#shearX} and {@link Bone#shearY}. */
|
|
192
|
+
export declare class ShearXTimeline extends CurveTimeline1 implements BoneTimeline {
|
|
193
|
+
boneIndex: number;
|
|
194
|
+
constructor(frameCount: number, bezierCount: number, boneIndex: number);
|
|
195
|
+
apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection): void;
|
|
196
|
+
}
|
|
197
|
+
/** Changes a bone's local {@link Bone#shearX} and {@link Bone#shearY}. */
|
|
198
|
+
export declare class ShearYTimeline extends CurveTimeline1 implements BoneTimeline {
|
|
199
|
+
boneIndex: number;
|
|
200
|
+
constructor(frameCount: number, bezierCount: number, boneIndex: number);
|
|
201
|
+
apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection): void;
|
|
202
|
+
}
|
|
203
|
+
/** Changes a slot's {@link Slot#color}. */
|
|
204
|
+
export declare class RGBATimeline extends CurveTimeline implements SlotTimeline {
|
|
205
|
+
slotIndex: number;
|
|
206
|
+
constructor(frameCount: number, bezierCount: number, slotIndex: number);
|
|
207
|
+
getFrameEntries(): number;
|
|
208
|
+
/** Sets the time in seconds, red, green, blue, and alpha for the specified key frame. */
|
|
209
|
+
setFrame(frame: number, time: number, r: number, g: number, b: number, a: number): void;
|
|
210
|
+
apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection): void;
|
|
211
|
+
}
|
|
212
|
+
/** Changes a slot's {@link Slot#color}. */
|
|
213
|
+
export declare class RGBTimeline extends CurveTimeline implements SlotTimeline {
|
|
214
|
+
slotIndex: number;
|
|
215
|
+
constructor(frameCount: number, bezierCount: number, slotIndex: number);
|
|
216
|
+
getFrameEntries(): number;
|
|
217
|
+
/** Sets the time in seconds, red, green, blue, and alpha for the specified key frame. */
|
|
218
|
+
setFrame(frame: number, time: number, r: number, g: number, b: number): void;
|
|
219
|
+
apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection): void;
|
|
220
|
+
}
|
|
221
|
+
/** Changes a bone's local {@link Bone#shearX} and {@link Bone#shearY}. */
|
|
222
|
+
export declare class AlphaTimeline extends CurveTimeline1 implements SlotTimeline {
|
|
223
|
+
slotIndex: number;
|
|
224
|
+
constructor(frameCount: number, bezierCount: number, slotIndex: number);
|
|
225
|
+
apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection): void;
|
|
226
|
+
}
|
|
227
|
+
/** Changes a slot's {@link Slot#color} and {@link Slot#darkColor} for two color tinting. */
|
|
228
|
+
export declare class RGBA2Timeline extends CurveTimeline implements SlotTimeline {
|
|
229
|
+
slotIndex: number;
|
|
230
|
+
constructor(frameCount: number, bezierCount: number, slotIndex: number);
|
|
231
|
+
getFrameEntries(): number;
|
|
232
|
+
/** Sets the time in seconds, light, and dark colors for the specified key frame. */
|
|
233
|
+
setFrame(frame: number, time: number, r: number, g: number, b: number, a: number, r2: number, g2: number, b2: number): void;
|
|
234
|
+
apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection): void;
|
|
235
|
+
}
|
|
236
|
+
/** Changes a slot's {@link Slot#color} and {@link Slot#darkColor} for two color tinting. */
|
|
237
|
+
export declare class RGB2Timeline extends CurveTimeline implements SlotTimeline {
|
|
238
|
+
slotIndex: number;
|
|
239
|
+
constructor(frameCount: number, bezierCount: number, slotIndex: number);
|
|
240
|
+
getFrameEntries(): number;
|
|
241
|
+
/** Sets the time in seconds, light, and dark colors for the specified key frame. */
|
|
242
|
+
setFrame(frame: number, time: number, r: number, g: number, b: number, r2: number, g2: number, b2: number): void;
|
|
243
|
+
apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection): void;
|
|
244
|
+
}
|
|
245
|
+
/** Changes a slot's {@link Slot#attachment}. */
|
|
246
|
+
export declare class AttachmentTimeline extends Timeline implements SlotTimeline {
|
|
247
|
+
slotIndex: number;
|
|
248
|
+
/** The attachment name for each key frame. May contain null values to clear the attachment. */
|
|
249
|
+
attachmentNames: Array<string | null>;
|
|
250
|
+
constructor(frameCount: number, slotIndex: number);
|
|
251
|
+
getFrameCount(): number;
|
|
252
|
+
/** Sets the time in seconds and the attachment name for the specified key frame. */
|
|
253
|
+
setFrame(frame: number, time: number, attachmentName: string | null): void;
|
|
254
|
+
apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection): void;
|
|
255
|
+
setAttachment(skeleton: Skeleton, slot: Slot, attachmentName: string | null): void;
|
|
256
|
+
}
|
|
257
|
+
/** Changes a slot's {@link Slot#deform} to deform a {@link VertexAttachment}. */
|
|
258
|
+
export declare class DeformTimeline extends CurveTimeline implements SlotTimeline {
|
|
259
|
+
slotIndex: number;
|
|
260
|
+
/** The attachment that will be deformed. */
|
|
261
|
+
attachment: VertexAttachment;
|
|
262
|
+
/** The vertices for each key frame. */
|
|
263
|
+
vertices: Array<NumberArrayLike | Array<number>>;
|
|
264
|
+
constructor(frameCount: number, bezierCount: number, slotIndex: number, attachment: VertexAttachment);
|
|
265
|
+
getFrameCount(): number;
|
|
266
|
+
/** Sets the time in seconds and the vertices for the specified key frame.
|
|
267
|
+
* @param vertices Vertex positions for an unweighted VertexAttachment, or deform offsets if it has weights. */
|
|
268
|
+
setFrame(frame: number, time: number, vertices: NumberArrayLike | Array<number>): void;
|
|
269
|
+
/** @param value1 Ignored (0 is used for a deform timeline).
|
|
270
|
+
* @param value2 Ignored (1 is used for a deform timeline). */
|
|
271
|
+
setBezier(bezier: number, frame: number, value: number, time1: number, value1: number, cx1: number, cy1: number, cx2: number, cy2: number, time2: number, value2: number): void;
|
|
272
|
+
getCurvePercent(time: number, frame: number): number;
|
|
273
|
+
apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection): void;
|
|
274
|
+
}
|
|
275
|
+
/** Fires an {@link Event} when specific animation times are reached. */
|
|
276
|
+
export declare class EventTimeline extends Timeline {
|
|
277
|
+
static propertyIds: string[];
|
|
278
|
+
/** The event for each key frame. */
|
|
279
|
+
events: Array<Event>;
|
|
280
|
+
constructor(frameCount: number);
|
|
281
|
+
getFrameCount(): number;
|
|
282
|
+
/** Sets the time in seconds and the event for the specified key frame. */
|
|
283
|
+
setFrame(frame: number, event: Event): void;
|
|
284
|
+
/** Fires events for frames > `lastTime` and <= `time`. */
|
|
285
|
+
apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection): void;
|
|
286
|
+
}
|
|
287
|
+
/** Changes a skeleton's {@link Skeleton#drawOrder}. */
|
|
288
|
+
export declare class DrawOrderTimeline extends Timeline {
|
|
289
|
+
static propertyIds: string[];
|
|
290
|
+
/** The draw order for each key frame. See {@link #setFrame(int, float, int[])}. */
|
|
291
|
+
drawOrders: Array<Array<number> | null>;
|
|
292
|
+
constructor(frameCount: number);
|
|
293
|
+
getFrameCount(): number;
|
|
294
|
+
/** Sets the time in seconds and the draw order for the specified key frame.
|
|
295
|
+
* @param drawOrder For each slot in {@link Skeleton#slots}, the index of the new draw order. May be null to use setup pose
|
|
296
|
+
* draw order. */
|
|
297
|
+
setFrame(frame: number, time: number, drawOrder: Array<number> | null): void;
|
|
298
|
+
apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection): void;
|
|
299
|
+
}
|
|
300
|
+
/** Changes an IK constraint's {@link IkConstraint#mix}, {@link IkConstraint#softness},
|
|
301
|
+
* {@link IkConstraint#bendDirection}, {@link IkConstraint#stretch}, and {@link IkConstraint#compress}. */
|
|
302
|
+
export declare class IkConstraintTimeline extends CurveTimeline {
|
|
303
|
+
/** The index of the IK constraint slot in {@link Skeleton#ikConstraints} that will be changed. */
|
|
304
|
+
ikConstraintIndex: number;
|
|
305
|
+
constructor(frameCount: number, bezierCount: number, ikConstraintIndex: number);
|
|
306
|
+
getFrameEntries(): number;
|
|
307
|
+
/** Sets the time in seconds, mix, softness, bend direction, compress, and stretch for the specified key frame. */
|
|
308
|
+
setFrame(frame: number, time: number, mix: number, softness: number, bendDirection: number, compress: boolean, stretch: boolean): void;
|
|
309
|
+
apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection): void;
|
|
310
|
+
}
|
|
311
|
+
/** Changes a transform constraint's {@link TransformConstraint#rotateMix}, {@link TransformConstraint#translateMix},
|
|
312
|
+
* {@link TransformConstraint#scaleMix}, and {@link TransformConstraint#shearMix}. */
|
|
313
|
+
export declare class TransformConstraintTimeline extends CurveTimeline {
|
|
314
|
+
/** The index of the transform constraint slot in {@link Skeleton#transformConstraints} that will be changed. */
|
|
315
|
+
transformConstraintIndex: number;
|
|
316
|
+
constructor(frameCount: number, bezierCount: number, transformConstraintIndex: number);
|
|
317
|
+
getFrameEntries(): number;
|
|
318
|
+
/** The time in seconds, rotate mix, translate mix, scale mix, and shear mix for the specified key frame. */
|
|
319
|
+
setFrame(frame: number, time: number, mixRotate: number, mixX: number, mixY: number, mixScaleX: number, mixScaleY: number, mixShearY: number): void;
|
|
320
|
+
apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection): void;
|
|
321
|
+
}
|
|
322
|
+
/** Changes a path constraint's {@link PathConstraint#position}. */
|
|
323
|
+
export declare class PathConstraintPositionTimeline extends CurveTimeline1 {
|
|
324
|
+
/** The index of the path constraint slot in {@link Skeleton#pathConstraints} that will be changed. */
|
|
325
|
+
pathConstraintIndex: number;
|
|
326
|
+
constructor(frameCount: number, bezierCount: number, pathConstraintIndex: number);
|
|
327
|
+
apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection): void;
|
|
328
|
+
}
|
|
329
|
+
/** Changes a path constraint's {@link PathConstraint#spacing}. */
|
|
330
|
+
export declare class PathConstraintSpacingTimeline extends CurveTimeline1 {
|
|
331
|
+
/** The index of the path constraint slot in {@link Skeleton#getPathConstraints()} that will be changed. */
|
|
332
|
+
pathConstraintIndex: number;
|
|
333
|
+
constructor(frameCount: number, bezierCount: number, pathConstraintIndex: number);
|
|
334
|
+
apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection): void;
|
|
335
|
+
}
|
|
336
|
+
/** Changes a transform constraint's {@link PathConstraint#getMixRotate()}, {@link PathConstraint#getMixX()}, and
|
|
337
|
+
* {@link PathConstraint#getMixY()}. */
|
|
338
|
+
export declare class PathConstraintMixTimeline extends CurveTimeline {
|
|
339
|
+
/** The index of the path constraint slot in {@link Skeleton#getPathConstraints()} that will be changed. */
|
|
340
|
+
pathConstraintIndex: number;
|
|
341
|
+
constructor(frameCount: number, bezierCount: number, pathConstraintIndex: number);
|
|
342
|
+
getFrameEntries(): number;
|
|
343
|
+
setFrame(frame: number, time: number, mixRotate: number, mixX: number, mixY: number): void;
|
|
344
|
+
apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection): void;
|
|
345
|
+
}
|
|
346
|
+
/** Changes a slot's {@link Slot#getSequenceIndex()} for an attachment's {@link Sequence}. */
|
|
347
|
+
export declare class SequenceTimeline extends Timeline implements SlotTimeline {
|
|
348
|
+
static ENTRIES: number;
|
|
349
|
+
static MODE: number;
|
|
350
|
+
static DELAY: number;
|
|
351
|
+
slotIndex: number;
|
|
352
|
+
attachment: HasTextureRegion;
|
|
353
|
+
constructor(frameCount: number, slotIndex: number, attachment: HasTextureRegion);
|
|
354
|
+
getFrameEntries(): number;
|
|
355
|
+
getSlotIndex(): number;
|
|
356
|
+
getAttachment(): Attachment;
|
|
357
|
+
/** Sets the time, mode, index, and frame time for the specified frame.
|
|
358
|
+
* @param frame Between 0 and <code>frameCount</code>, inclusive.
|
|
359
|
+
* @param time Seconds between frames. */
|
|
360
|
+
setFrame(frame: number, time: number, mode: SequenceMode, index: number, delay: number): void;
|
|
361
|
+
apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection): void;
|
|
362
|
+
}
|