@galacean/engine-spine 4.2.1 → 4.2.2
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/browser.js +1 -1
- package/dist/main.js +6 -4
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +6 -4
- package/dist/module.js +6 -4
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
- package/types/SpineAnimation.d.ts +48 -0
- package/types/SpineLoader.d.ts +32 -0
- package/types/SpineMaterial.d.ts +6 -0
- package/types/SpineRenderer.d.ts +38 -0
- package/types/core/MeshGenerator.d.ts +43 -0
- package/types/core/SpineMesh.d.ts +11 -0
- package/types/spine-core/Animation.d.ts +378 -0
- package/types/spine-core/AnimationState.d.ts +365 -0
- package/types/spine-core/AnimationStateData.d.ts +23 -0
- package/types/spine-core/AssetManager.d.ts +36 -0
- package/types/spine-core/AtlasAttachmentLoader.d.ts +23 -0
- package/types/spine-core/BlendMode.d.ts +7 -0
- package/types/spine-core/Bone.d.ts +110 -0
- package/types/spine-core/BoneData.d.ts +44 -0
- package/types/spine-core/ConstraintData.d.ts +7 -0
- package/types/spine-core/Event.d.ts +16 -0
- package/types/spine-core/EventData.d.ts +13 -0
- package/types/spine-core/IkConstraint.d.ts +38 -0
- package/types/spine-core/IkConstraintData.d.ts +26 -0
- package/types/spine-core/PathConstraint.d.ts +46 -0
- package/types/spine-core/PathConstraintData.d.ts +52 -0
- package/types/spine-core/SharedAssetManager.d.ts +19 -0
- package/types/spine-core/Skeleton.d.ts +134 -0
- package/types/spine-core/SkeletonBinary.d.ts +49 -0
- package/types/spine-core/SkeletonBounds.d.ts +48 -0
- package/types/spine-core/SkeletonClipping.d.ts +22 -0
- package/types/spine-core/SkeletonData.d.ts +89 -0
- package/types/spine-core/SkeletonJson.d.ts +34 -0
- package/types/spine-core/Skin.d.ts +43 -0
- package/types/spine-core/Slot.d.ts +42 -0
- package/types/spine-core/SlotData.d.ts +23 -0
- package/types/spine-core/Texture.d.ts +46 -0
- package/types/spine-core/TextureAtlas.d.ts +30 -0
- package/types/spine-core/TransformConstraint.d.ts +36 -0
- package/types/spine-core/TransformConstraintData.d.ts +34 -0
- package/types/spine-core/Triangulator.d.ts +14 -0
- package/types/spine-core/Updatable.d.ts +9 -0
- package/types/spine-core/Utils.d.ts +124 -0
- package/types/spine-core/VertexEffect.d.ts +7 -0
- package/types/spine-core/attachments/Attachment.d.ts +43 -0
- package/types/spine-core/attachments/AttachmentLoader.d.ts +25 -0
- package/types/spine-core/attachments/AttachmentType.d.ts +9 -0
- package/types/spine-core/attachments/BoundingBoxAttachment.d.ts +12 -0
- package/types/spine-core/attachments/ClippingAttachment.d.ts +14 -0
- package/types/spine-core/attachments/MeshAttachment.d.ts +46 -0
- package/types/spine-core/attachments/PathAttachment.d.ts +19 -0
- package/types/spine-core/attachments/PointAttachment.d.ts +20 -0
- package/types/spine-core/attachments/RegionAttachment.d.ts +88 -0
- package/types/spine-core/polyfills.d.ts +3 -0
- package/types/spine-core/vertexeffects/JitterEffect.d.ts +11 -0
- package/types/spine-core/vertexeffects/SwirlEffect.d.ts +16 -0
- package/types/types.d.ts +4 -0
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "4.2.
|
|
2
|
+
"version": "4.2.2",
|
|
3
3
|
"description": "galacean spine runtime",
|
|
4
4
|
"name": "@galacean/engine-spine",
|
|
5
5
|
"main": "dist/main.js",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"@esotericsoftware/spine-core": "~4.2.66"
|
|
10
10
|
},
|
|
11
11
|
"peerDependencies": {
|
|
12
|
-
"@galacean/engine": ">=1.
|
|
12
|
+
"@galacean/engine": ">=1.5.0"
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
15
|
"@babel/core": "^7.26.0",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"@babel/plugin-transform-object-assign": "^7.25.9",
|
|
21
21
|
"@babel/preset-env": "^7.26.0",
|
|
22
22
|
"@babel/preset-typescript": "^7.26.0",
|
|
23
|
-
"@galacean/engine": "^1.
|
|
23
|
+
"@galacean/engine": "^1.5.0",
|
|
24
24
|
"@galacean/engine-toolkit": "beta",
|
|
25
25
|
"@rollup/plugin-babel": "^5.3.1",
|
|
26
26
|
"@rollup/plugin-commonjs": "^16.0.0",
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Skeleton } from "./spine-core/Skeleton";
|
|
2
|
+
import { SkeletonData } from "./spine-core/SkeletonData";
|
|
3
|
+
import { AnimationState } from "./spine-core/AnimationState";
|
|
4
|
+
import { MeshGenerator } from "./core/MeshGenerator";
|
|
5
|
+
import { SpineRenderSetting } from "./types";
|
|
6
|
+
import { Script, Entity, Texture2D, Material, Engine } from "@galacean/engine";
|
|
7
|
+
export declare class SpineAnimation extends Script {
|
|
8
|
+
/** Spine 材质 */
|
|
9
|
+
private static _defaultMaterial;
|
|
10
|
+
static getDefaultMaterial(engine: Engine): Material;
|
|
11
|
+
/** @internal */
|
|
12
|
+
_heldTextures: Texture2D[];
|
|
13
|
+
private _skeletonData;
|
|
14
|
+
private _skeleton;
|
|
15
|
+
private _state;
|
|
16
|
+
private _tempOffset;
|
|
17
|
+
private _tempSize;
|
|
18
|
+
private _tempArray;
|
|
19
|
+
protected _meshGenerator: MeshGenerator;
|
|
20
|
+
setting: SpineRenderSetting;
|
|
21
|
+
autoUpdateBounds: boolean;
|
|
22
|
+
noPause: boolean;
|
|
23
|
+
get skeletonData(): SkeletonData;
|
|
24
|
+
get skeleton(): Skeleton;
|
|
25
|
+
get state(): AnimationState;
|
|
26
|
+
get mesh(): import("@galacean/engine").BufferMesh;
|
|
27
|
+
set scale(v: number);
|
|
28
|
+
constructor(entity: Entity);
|
|
29
|
+
setSkeletonData(skeletonData: SkeletonData, setting?: SpineRenderSetting): void;
|
|
30
|
+
/**
|
|
31
|
+
* Separate slot by slot name. This will add a new sub mesh, and new materials.
|
|
32
|
+
*/
|
|
33
|
+
addSeparateSlot(slotName: string): void;
|
|
34
|
+
/**
|
|
35
|
+
* Change texture of a separated slot by name.
|
|
36
|
+
*/
|
|
37
|
+
hackSeparateSlotTexture(slotName: string, texture: Texture2D): void;
|
|
38
|
+
onUpdate(delta: number): void;
|
|
39
|
+
updateGeometry(): void;
|
|
40
|
+
updateBounds(): void;
|
|
41
|
+
/**
|
|
42
|
+
* Spine animation custom clone.
|
|
43
|
+
*/
|
|
44
|
+
_cloneTo(target: SpineAnimation): void;
|
|
45
|
+
private _disposeCurrentSkeleton;
|
|
46
|
+
private _disposeTextures;
|
|
47
|
+
onDestroy(): void;
|
|
48
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { AssetPromise, Loader, LoadItem, ResourceManager, TextureWrapMode, Texture2D, Entity, AssetType } from "@galacean/engine";
|
|
2
|
+
import { AssetManager } from "./spine-core/AssetManager";
|
|
3
|
+
import { Texture } from "./spine-core/Texture";
|
|
4
|
+
type SpineResouce = {
|
|
5
|
+
skeletonFile: string;
|
|
6
|
+
atlasFile: string;
|
|
7
|
+
textureFile?: string;
|
|
8
|
+
textureType?: AssetType;
|
|
9
|
+
};
|
|
10
|
+
type SpineOpt = {
|
|
11
|
+
scale: number;
|
|
12
|
+
};
|
|
13
|
+
type SpineLoadItem = LoadItem & SpineOpt;
|
|
14
|
+
declare class SpineLoader extends Loader<Entity> {
|
|
15
|
+
load(item: SpineLoadItem, resourceManager: ResourceManager): AssetPromise<Entity>;
|
|
16
|
+
handleResource(resourceManager: ResourceManager, item: SpineLoadItem, resource: SpineResouce, resolve: any, reject: any): void;
|
|
17
|
+
textureAssetPicker(assetManager: AssetManager, textureFile: string): any;
|
|
18
|
+
createAdaptiveTexture(texture: Texture2D): AdaptiveTexture;
|
|
19
|
+
isBinFile(url: string): boolean;
|
|
20
|
+
checkUrl(url: string): boolean;
|
|
21
|
+
getResouceFromUrl(url: any): SpineResouce;
|
|
22
|
+
checkUrls(urls: string[]): boolean;
|
|
23
|
+
getResouceFromUrls(urls: string[], type?: AssetType): SpineResouce;
|
|
24
|
+
getExtFromUrl(url: string): string;
|
|
25
|
+
}
|
|
26
|
+
export declare class AdaptiveTexture extends Texture {
|
|
27
|
+
constructor(texture: Texture2D);
|
|
28
|
+
setFilters(minFilter: any, magFilter: any): void;
|
|
29
|
+
setWraps(uWrap: TextureWrapMode, vWrap: TextureWrapMode): void;
|
|
30
|
+
dispose(): void;
|
|
31
|
+
}
|
|
32
|
+
export { SpineLoader };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Script, Entity } from "@galacean/engine";
|
|
2
|
+
import { SpineAnimation } from "./SpineAnimation";
|
|
3
|
+
export declare class SpineRenderer extends Script {
|
|
4
|
+
private _priority;
|
|
5
|
+
private _resource;
|
|
6
|
+
private _animationName;
|
|
7
|
+
private _loop;
|
|
8
|
+
private _paused;
|
|
9
|
+
private _autoPlay;
|
|
10
|
+
private _skinName;
|
|
11
|
+
private _scale;
|
|
12
|
+
private _spineAnimation;
|
|
13
|
+
/** @internal */
|
|
14
|
+
_animationNames: Array<string>;
|
|
15
|
+
/** @internal */
|
|
16
|
+
_skinNames: Array<string>;
|
|
17
|
+
get priority(): number;
|
|
18
|
+
set priority(value: number);
|
|
19
|
+
get resource(): Entity | null;
|
|
20
|
+
set resource(value: Entity | null);
|
|
21
|
+
get animationName(): string;
|
|
22
|
+
set animationName(name: string);
|
|
23
|
+
get loop(): boolean;
|
|
24
|
+
set loop(value: boolean);
|
|
25
|
+
get paused(): boolean;
|
|
26
|
+
set paused(value: boolean);
|
|
27
|
+
get autoPlay(): boolean;
|
|
28
|
+
set autoPlay(value: boolean);
|
|
29
|
+
get skinName(): string;
|
|
30
|
+
set skinName(name: string);
|
|
31
|
+
get scale(): number;
|
|
32
|
+
set scale(value: number);
|
|
33
|
+
get spineAnimation(): SpineAnimation;
|
|
34
|
+
onDestroy(): void;
|
|
35
|
+
play(name?: string, loop?: boolean): void;
|
|
36
|
+
_cloneTo(target: SpineRenderer): void;
|
|
37
|
+
private _removeResource;
|
|
38
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Engine, Entity, SubMesh, Texture2D } from "@galacean/engine";
|
|
2
|
+
import { Skeleton } from "../spine-core/Skeleton";
|
|
3
|
+
import { SkeletonData } from "../spine-core/SkeletonData";
|
|
4
|
+
import { Color } from "../spine-core/Utils";
|
|
5
|
+
import { SpineRenderSetting } from "../types";
|
|
6
|
+
import { BlendMode } from "../spine-core/BlendMode";
|
|
7
|
+
type SubMeshItem = {
|
|
8
|
+
subMesh: SubMesh;
|
|
9
|
+
blendMode: BlendMode;
|
|
10
|
+
texture: any;
|
|
11
|
+
slotName?: string;
|
|
12
|
+
};
|
|
13
|
+
export declare class MeshGenerator {
|
|
14
|
+
static QUAD_TRIANGLES: number[];
|
|
15
|
+
static VERTEX_SIZE: number;
|
|
16
|
+
static VERTEX_STRIDE: number;
|
|
17
|
+
static tempColor: Color;
|
|
18
|
+
static tempBlendMode: BlendMode | null;
|
|
19
|
+
private _setting;
|
|
20
|
+
private _engine;
|
|
21
|
+
private _entity;
|
|
22
|
+
private _clipper;
|
|
23
|
+
private _spineMesh;
|
|
24
|
+
private _vertexCount;
|
|
25
|
+
private _vertices;
|
|
26
|
+
private _verticesWithZ;
|
|
27
|
+
private _indices;
|
|
28
|
+
private _needResize;
|
|
29
|
+
private _meshRenderer;
|
|
30
|
+
private _subMeshItems;
|
|
31
|
+
readonly separateSlots: string[];
|
|
32
|
+
readonly separateSlotTextureMap: Map<string, Texture2D>;
|
|
33
|
+
get mesh(): import("@galacean/engine").BufferMesh;
|
|
34
|
+
get subMeshItems(): SubMeshItem[];
|
|
35
|
+
constructor(engine: Engine, entity: Entity);
|
|
36
|
+
initialize(skeletonData: SkeletonData, setting?: SpineRenderSetting): void;
|
|
37
|
+
buildMesh(skeleton: Skeleton): void;
|
|
38
|
+
addSeparateSlot(slotName: string): void;
|
|
39
|
+
addSeparateSlotTexture(slotName: string, texture: Texture2D): void;
|
|
40
|
+
private _prepareBufferData;
|
|
41
|
+
private setBlendMode;
|
|
42
|
+
}
|
|
43
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BufferMesh, Engine, Buffer } from '@galacean/engine';
|
|
2
|
+
export declare class SpineMesh {
|
|
3
|
+
private _mesh;
|
|
4
|
+
private _indexBuffer;
|
|
5
|
+
private _vertexBuffer;
|
|
6
|
+
get mesh(): BufferMesh;
|
|
7
|
+
get indexBuffer(): Buffer;
|
|
8
|
+
get vertexBuffer(): Buffer;
|
|
9
|
+
initialize(engine: Engine, vertexCount: number): void;
|
|
10
|
+
changeBuffer(engine: Engine, vertexCount: number): void;
|
|
11
|
+
}
|
|
@@ -0,0 +1,378 @@
|
|
|
1
|
+
import { Skeleton } from "./Skeleton";
|
|
2
|
+
import { ArrayLike } from "./Utils";
|
|
3
|
+
import { Slot } from "./Slot";
|
|
4
|
+
import { VertexAttachment } from "./attachments/Attachment";
|
|
5
|
+
import { Event } from "./Event";
|
|
6
|
+
/** A simple container for a list of timelines and a name. */
|
|
7
|
+
export declare class Animation {
|
|
8
|
+
/** The animation's name, which is unique across all animations in the skeleton. */
|
|
9
|
+
name: string;
|
|
10
|
+
timelines: Array<Timeline>;
|
|
11
|
+
timelineIds: Array<boolean>;
|
|
12
|
+
/** The duration of the animation in seconds, which is the highest time of all keys in the timeline. */
|
|
13
|
+
duration: number;
|
|
14
|
+
constructor(name: string, timelines: Array<Timeline>, duration: number);
|
|
15
|
+
hasTimeline(id: number): boolean;
|
|
16
|
+
/** Applies all the animation's timelines to the specified skeleton.
|
|
17
|
+
*
|
|
18
|
+
* See Timeline {@link Timeline#apply(Skeleton, float, float, Array, float, MixBlend, MixDirection)}.
|
|
19
|
+
* @param loop If true, the animation repeats after {@link #getDuration()}.
|
|
20
|
+
* @param events May be null to ignore fired events. */
|
|
21
|
+
apply(skeleton: Skeleton, lastTime: number, time: number, loop: boolean, events: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection): void;
|
|
22
|
+
/** @param target After the first and before the last value.
|
|
23
|
+
* @returns index of first value greater than the target. */
|
|
24
|
+
static binarySearch(values: ArrayLike<number>, target: number, step?: number): number;
|
|
25
|
+
static linearSearch(values: ArrayLike<number>, target: number, step: number): number;
|
|
26
|
+
}
|
|
27
|
+
/** The interface for all timelines. */
|
|
28
|
+
export interface Timeline {
|
|
29
|
+
/** Applies this timeline to the skeleton.
|
|
30
|
+
* @param skeleton The skeleton the timeline is being applied to. This provides access to the bones, slots, and other
|
|
31
|
+
* skeleton components the timeline may change.
|
|
32
|
+
* @param lastTime The time this timeline was last applied. Timelines such as {@link EventTimeline}} trigger only at specific
|
|
33
|
+
* times rather than every frame. In that case, the timeline triggers everything between `lastTime`
|
|
34
|
+
* (exclusive) and `time` (inclusive).
|
|
35
|
+
* @param time The time within the animation. Most timelines find the key before and the key after this time so they can
|
|
36
|
+
* interpolate between the keys.
|
|
37
|
+
* @param events If any events are fired, they are added to this list. Can be null to ignore fired events or if the timeline
|
|
38
|
+
* does not fire events.
|
|
39
|
+
* @param alpha 0 applies the current or setup value (depending on `blend`). 1 applies the timeline value.
|
|
40
|
+
* Between 0 and 1 applies a value between the current or setup value and the timeline value. By adjusting
|
|
41
|
+
* `alpha` over time, an animation can be mixed in or out. `alpha` can also be useful to
|
|
42
|
+
* apply animations on top of each other (layering).
|
|
43
|
+
* @param blend Controls how mixing is applied when `alpha` < 1.
|
|
44
|
+
* @param direction Indicates whether the timeline is mixing in or out. Used by timelines which perform instant transitions,
|
|
45
|
+
* such as {@link DrawOrderTimeline} or {@link AttachmentTimeline}. */
|
|
46
|
+
apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection): void;
|
|
47
|
+
/** Uniquely encodes both the type of this timeline and the skeleton property that it affects. */
|
|
48
|
+
getPropertyId(): number;
|
|
49
|
+
}
|
|
50
|
+
/** Controls how a timeline value is mixed with the setup pose value or current pose value when a timeline's `alpha`
|
|
51
|
+
* < 1.
|
|
52
|
+
*
|
|
53
|
+
* See Timeline {@link Timeline#apply(Skeleton, float, float, Array, float, MixBlend, MixDirection)}. */
|
|
54
|
+
export declare enum MixBlend {
|
|
55
|
+
/** Transitions from the setup value to the timeline value (the current value is not used). Before the first key, the setup
|
|
56
|
+
* value is set. */
|
|
57
|
+
setup = 0,
|
|
58
|
+
/** Transitions from the current value to the timeline value. Before the first key, transitions from the current value to
|
|
59
|
+
* the setup value. Timelines which perform instant transitions, such as {@link DrawOrderTimeline} or
|
|
60
|
+
* {@link AttachmentTimeline}, use the setup value before the first key.
|
|
61
|
+
*
|
|
62
|
+
* `first` is intended for the first animations applied, not for animations layered on top of those. */
|
|
63
|
+
first = 1,
|
|
64
|
+
/** Transitions from the current value to the timeline value. No change is made before the first key (the current value is
|
|
65
|
+
* kept until the first key).
|
|
66
|
+
*
|
|
67
|
+
* `replace` is intended for animations layered on top of others, not for the first animations applied. */
|
|
68
|
+
replace = 2,
|
|
69
|
+
/** Transitions from the current value to the current value plus the timeline value. No change is made before the first key
|
|
70
|
+
* (the current value is kept until the first key).
|
|
71
|
+
*
|
|
72
|
+
* `add` is intended for animations layered on top of others, not for the first animations applied. Properties
|
|
73
|
+
* keyed by additive animations must be set manually or by another animation before applying the additive animations, else
|
|
74
|
+
* the property values will increase continually. */
|
|
75
|
+
add = 3
|
|
76
|
+
}
|
|
77
|
+
/** Indicates whether a timeline's `alpha` is mixing out over time toward 0 (the setup or current pose value) or
|
|
78
|
+
* mixing in toward 1 (the timeline's value).
|
|
79
|
+
*
|
|
80
|
+
* See Timeline {@link Timeline#apply(Skeleton, float, float, Array, float, MixBlend, MixDirection)}. */
|
|
81
|
+
export declare enum MixDirection {
|
|
82
|
+
mixIn = 0,
|
|
83
|
+
mixOut = 1
|
|
84
|
+
}
|
|
85
|
+
export declare enum TimelineType {
|
|
86
|
+
rotate = 0,
|
|
87
|
+
translate = 1,
|
|
88
|
+
scale = 2,
|
|
89
|
+
shear = 3,
|
|
90
|
+
attachment = 4,
|
|
91
|
+
color = 5,
|
|
92
|
+
deform = 6,
|
|
93
|
+
event = 7,
|
|
94
|
+
drawOrder = 8,
|
|
95
|
+
ikConstraint = 9,
|
|
96
|
+
transformConstraint = 10,
|
|
97
|
+
pathConstraintPosition = 11,
|
|
98
|
+
pathConstraintSpacing = 12,
|
|
99
|
+
pathConstraintMix = 13,
|
|
100
|
+
twoColor = 14
|
|
101
|
+
}
|
|
102
|
+
/** The base class for timelines that use interpolation between key frame values. */
|
|
103
|
+
export declare abstract class CurveTimeline implements Timeline {
|
|
104
|
+
static LINEAR: number;
|
|
105
|
+
static STEPPED: number;
|
|
106
|
+
static BEZIER: number;
|
|
107
|
+
static BEZIER_SIZE: number;
|
|
108
|
+
private curves;
|
|
109
|
+
abstract getPropertyId(): number;
|
|
110
|
+
constructor(frameCount: number);
|
|
111
|
+
/** The number of key frames for this timeline. */
|
|
112
|
+
getFrameCount(): number;
|
|
113
|
+
/** Sets the specified key frame to linear interpolation. */
|
|
114
|
+
setLinear(frameIndex: number): void;
|
|
115
|
+
/** Sets the specified key frame to stepped interpolation. */
|
|
116
|
+
setStepped(frameIndex: number): void;
|
|
117
|
+
/** Returns the interpolation type for the specified key frame.
|
|
118
|
+
* @returns Linear is 0, stepped is 1, Bezier is 2. */
|
|
119
|
+
getCurveType(frameIndex: number): number;
|
|
120
|
+
/** Sets the specified key frame to Bezier interpolation. `cx1` and `cx2` are from 0 to 1,
|
|
121
|
+
* representing the percent of time between the two key frames. `cy1` and `cy2` are the percent of the
|
|
122
|
+
* difference between the key frame's values. */
|
|
123
|
+
setCurve(frameIndex: number, cx1: number, cy1: number, cx2: number, cy2: number): void;
|
|
124
|
+
/** Returns the interpolated percentage for the specified key frame and linear percentage. */
|
|
125
|
+
getCurvePercent(frameIndex: number, percent: number): number;
|
|
126
|
+
abstract apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection): void;
|
|
127
|
+
}
|
|
128
|
+
/** Changes a bone's local {@link Bone#rotation}. */
|
|
129
|
+
export declare class RotateTimeline extends CurveTimeline {
|
|
130
|
+
static ENTRIES: number;
|
|
131
|
+
static PREV_TIME: number;
|
|
132
|
+
static PREV_ROTATION: number;
|
|
133
|
+
static ROTATION: number;
|
|
134
|
+
/** The index of the bone in {@link Skeleton#bones} that will be changed. */
|
|
135
|
+
boneIndex: number;
|
|
136
|
+
/** The time in seconds and rotation in degrees for each key frame. */
|
|
137
|
+
frames: ArrayLike<number>;
|
|
138
|
+
constructor(frameCount: number);
|
|
139
|
+
getPropertyId(): number;
|
|
140
|
+
/** Sets the time and angle of the specified keyframe. */
|
|
141
|
+
setFrame(frameIndex: number, time: number, degrees: number): void;
|
|
142
|
+
apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection): void;
|
|
143
|
+
}
|
|
144
|
+
/** Changes a bone's local {@link Bone#x} and {@link Bone#y}. */
|
|
145
|
+
export declare class TranslateTimeline extends CurveTimeline {
|
|
146
|
+
static ENTRIES: number;
|
|
147
|
+
static PREV_TIME: number;
|
|
148
|
+
static PREV_X: number;
|
|
149
|
+
static PREV_Y: number;
|
|
150
|
+
static X: number;
|
|
151
|
+
static Y: number;
|
|
152
|
+
/** The index of the bone in {@link Skeleton#bones} that will be changed. */
|
|
153
|
+
boneIndex: number;
|
|
154
|
+
/** The time in seconds, x, and y values for each key frame. */
|
|
155
|
+
frames: ArrayLike<number>;
|
|
156
|
+
constructor(frameCount: number);
|
|
157
|
+
getPropertyId(): number;
|
|
158
|
+
/** Sets the time in seconds, x, and y values for the specified key frame. */
|
|
159
|
+
setFrame(frameIndex: number, time: number, x: number, y: number): void;
|
|
160
|
+
apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection): void;
|
|
161
|
+
}
|
|
162
|
+
/** Changes a bone's local {@link Bone#scaleX)} and {@link Bone#scaleY}. */
|
|
163
|
+
export declare class ScaleTimeline extends TranslateTimeline {
|
|
164
|
+
constructor(frameCount: number);
|
|
165
|
+
getPropertyId(): number;
|
|
166
|
+
apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection): void;
|
|
167
|
+
}
|
|
168
|
+
/** Changes a bone's local {@link Bone#shearX} and {@link Bone#shearY}. */
|
|
169
|
+
export declare class ShearTimeline extends TranslateTimeline {
|
|
170
|
+
constructor(frameCount: number);
|
|
171
|
+
getPropertyId(): number;
|
|
172
|
+
apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection): void;
|
|
173
|
+
}
|
|
174
|
+
/** Changes a slot's {@link Slot#color}. */
|
|
175
|
+
export declare class ColorTimeline extends CurveTimeline {
|
|
176
|
+
static ENTRIES: number;
|
|
177
|
+
static PREV_TIME: number;
|
|
178
|
+
static PREV_R: number;
|
|
179
|
+
static PREV_G: number;
|
|
180
|
+
static PREV_B: number;
|
|
181
|
+
static PREV_A: number;
|
|
182
|
+
static R: number;
|
|
183
|
+
static G: number;
|
|
184
|
+
static B: number;
|
|
185
|
+
static A: number;
|
|
186
|
+
/** The index of the slot in {@link Skeleton#slots} that will be changed. */
|
|
187
|
+
slotIndex: number;
|
|
188
|
+
/** The time in seconds, red, green, blue, and alpha values for each key frame. */
|
|
189
|
+
frames: ArrayLike<number>;
|
|
190
|
+
constructor(frameCount: number);
|
|
191
|
+
getPropertyId(): number;
|
|
192
|
+
/** Sets the time in seconds, red, green, blue, and alpha for the specified key frame. */
|
|
193
|
+
setFrame(frameIndex: number, time: number, r: number, g: number, b: number, a: number): void;
|
|
194
|
+
apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection): void;
|
|
195
|
+
}
|
|
196
|
+
/** Changes a slot's {@link Slot#color} and {@link Slot#darkColor} for two color tinting. */
|
|
197
|
+
export declare class TwoColorTimeline extends CurveTimeline {
|
|
198
|
+
static ENTRIES: number;
|
|
199
|
+
static PREV_TIME: number;
|
|
200
|
+
static PREV_R: number;
|
|
201
|
+
static PREV_G: number;
|
|
202
|
+
static PREV_B: number;
|
|
203
|
+
static PREV_A: number;
|
|
204
|
+
static PREV_R2: number;
|
|
205
|
+
static PREV_G2: number;
|
|
206
|
+
static PREV_B2: number;
|
|
207
|
+
static R: number;
|
|
208
|
+
static G: number;
|
|
209
|
+
static B: number;
|
|
210
|
+
static A: number;
|
|
211
|
+
static R2: number;
|
|
212
|
+
static G2: number;
|
|
213
|
+
static B2: number;
|
|
214
|
+
/** The index of the slot in {@link Skeleton#slots()} that will be changed. The {@link Slot#darkColor()} must not be
|
|
215
|
+
* null. */
|
|
216
|
+
slotIndex: number;
|
|
217
|
+
/** The time in seconds, red, green, blue, and alpha values of the color, red, green, blue of the dark color, for each key frame. */
|
|
218
|
+
frames: ArrayLike<number>;
|
|
219
|
+
constructor(frameCount: number);
|
|
220
|
+
getPropertyId(): number;
|
|
221
|
+
/** Sets the time in seconds, light, and dark colors for the specified key frame. */
|
|
222
|
+
setFrame(frameIndex: number, time: number, r: number, g: number, b: number, a: number, r2: number, g2: number, b2: number): void;
|
|
223
|
+
apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection): void;
|
|
224
|
+
}
|
|
225
|
+
/** Changes a slot's {@link Slot#attachment}. */
|
|
226
|
+
export declare class AttachmentTimeline implements Timeline {
|
|
227
|
+
/** The index of the slot in {@link Skeleton#slots} that will be changed. */
|
|
228
|
+
slotIndex: number;
|
|
229
|
+
/** The time in seconds for each key frame. */
|
|
230
|
+
frames: ArrayLike<number>;
|
|
231
|
+
/** The attachment name for each key frame. May contain null values to clear the attachment. */
|
|
232
|
+
attachmentNames: Array<string>;
|
|
233
|
+
constructor(frameCount: number);
|
|
234
|
+
getPropertyId(): number;
|
|
235
|
+
/** The number of key frames for this timeline. */
|
|
236
|
+
getFrameCount(): number;
|
|
237
|
+
/** Sets the time in seconds and the attachment name for the specified key frame. */
|
|
238
|
+
setFrame(frameIndex: number, time: number, attachmentName: string): void;
|
|
239
|
+
apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection): void;
|
|
240
|
+
setAttachment(skeleton: Skeleton, slot: Slot, attachmentName: string): void;
|
|
241
|
+
}
|
|
242
|
+
/** Changes a slot's {@link Slot#deform} to deform a {@link VertexAttachment}. */
|
|
243
|
+
export declare class DeformTimeline extends CurveTimeline {
|
|
244
|
+
/** The index of the slot in {@link Skeleton#getSlots()} that will be changed. */
|
|
245
|
+
slotIndex: number;
|
|
246
|
+
/** The attachment that will be deformed. */
|
|
247
|
+
attachment: VertexAttachment;
|
|
248
|
+
/** The time in seconds for each key frame. */
|
|
249
|
+
frames: ArrayLike<number>;
|
|
250
|
+
/** The vertices for each key frame. */
|
|
251
|
+
frameVertices: Array<ArrayLike<number>>;
|
|
252
|
+
constructor(frameCount: number);
|
|
253
|
+
getPropertyId(): number;
|
|
254
|
+
/** Sets the time in seconds and the vertices for the specified key frame.
|
|
255
|
+
* @param vertices Vertex positions for an unweighted VertexAttachment, or deform offsets if it has weights. */
|
|
256
|
+
setFrame(frameIndex: number, time: number, vertices: ArrayLike<number>): void;
|
|
257
|
+
apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection): void;
|
|
258
|
+
}
|
|
259
|
+
/** Fires an {@link Event} when specific animation times are reached. */
|
|
260
|
+
export declare class EventTimeline implements Timeline {
|
|
261
|
+
/** The time in seconds for each key frame. */
|
|
262
|
+
frames: ArrayLike<number>;
|
|
263
|
+
/** The event for each key frame. */
|
|
264
|
+
events: Array<Event>;
|
|
265
|
+
constructor(frameCount: number);
|
|
266
|
+
getPropertyId(): number;
|
|
267
|
+
/** The number of key frames for this timeline. */
|
|
268
|
+
getFrameCount(): number;
|
|
269
|
+
/** Sets the time in seconds and the event for the specified key frame. */
|
|
270
|
+
setFrame(frameIndex: number, event: Event): void;
|
|
271
|
+
/** Fires events for frames > `lastTime` and <= `time`. */
|
|
272
|
+
apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection): void;
|
|
273
|
+
}
|
|
274
|
+
/** Changes a skeleton's {@link Skeleton#drawOrder}. */
|
|
275
|
+
export declare class DrawOrderTimeline implements Timeline {
|
|
276
|
+
/** The time in seconds for each key frame. */
|
|
277
|
+
frames: ArrayLike<number>;
|
|
278
|
+
/** The draw order for each key frame. See {@link #setFrame(int, float, int[])}. */
|
|
279
|
+
drawOrders: Array<Array<number>>;
|
|
280
|
+
constructor(frameCount: number);
|
|
281
|
+
getPropertyId(): number;
|
|
282
|
+
/** The number of key frames for this timeline. */
|
|
283
|
+
getFrameCount(): number;
|
|
284
|
+
/** Sets the time in seconds and the draw order for the specified key frame.
|
|
285
|
+
* @param drawOrder For each slot in {@link Skeleton#slots}, the index of the new draw order. May be null to use setup pose
|
|
286
|
+
* draw order. */
|
|
287
|
+
setFrame(frameIndex: number, time: number, drawOrder: Array<number>): void;
|
|
288
|
+
apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection): void;
|
|
289
|
+
}
|
|
290
|
+
/** Changes an IK constraint's {@link IkConstraint#mix}, {@link IkConstraint#softness},
|
|
291
|
+
* {@link IkConstraint#bendDirection}, {@link IkConstraint#stretch}, and {@link IkConstraint#compress}. */
|
|
292
|
+
export declare class IkConstraintTimeline extends CurveTimeline {
|
|
293
|
+
static ENTRIES: number;
|
|
294
|
+
static PREV_TIME: number;
|
|
295
|
+
static PREV_MIX: number;
|
|
296
|
+
static PREV_SOFTNESS: number;
|
|
297
|
+
static PREV_BEND_DIRECTION: number;
|
|
298
|
+
static PREV_COMPRESS: number;
|
|
299
|
+
static PREV_STRETCH: number;
|
|
300
|
+
static MIX: number;
|
|
301
|
+
static SOFTNESS: number;
|
|
302
|
+
static BEND_DIRECTION: number;
|
|
303
|
+
static COMPRESS: number;
|
|
304
|
+
static STRETCH: number;
|
|
305
|
+
/** The index of the IK constraint slot in {@link Skeleton#ikConstraints} that will be changed. */
|
|
306
|
+
ikConstraintIndex: number;
|
|
307
|
+
/** The time in seconds, mix, softness, bend direction, compress, and stretch for each key frame. */
|
|
308
|
+
frames: ArrayLike<number>;
|
|
309
|
+
constructor(frameCount: number);
|
|
310
|
+
getPropertyId(): number;
|
|
311
|
+
/** Sets the time in seconds, mix, softness, bend direction, compress, and stretch for the specified key frame. */
|
|
312
|
+
setFrame(frameIndex: number, time: number, mix: number, softness: number, bendDirection: number, compress: boolean, stretch: boolean): void;
|
|
313
|
+
apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection): void;
|
|
314
|
+
}
|
|
315
|
+
/** Changes a transform constraint's {@link TransformConstraint#rotateMix}, {@link TransformConstraint#translateMix},
|
|
316
|
+
* {@link TransformConstraint#scaleMix}, and {@link TransformConstraint#shearMix}. */
|
|
317
|
+
export declare class TransformConstraintTimeline extends CurveTimeline {
|
|
318
|
+
static ENTRIES: number;
|
|
319
|
+
static PREV_TIME: number;
|
|
320
|
+
static PREV_ROTATE: number;
|
|
321
|
+
static PREV_TRANSLATE: number;
|
|
322
|
+
static PREV_SCALE: number;
|
|
323
|
+
static PREV_SHEAR: number;
|
|
324
|
+
static ROTATE: number;
|
|
325
|
+
static TRANSLATE: number;
|
|
326
|
+
static SCALE: number;
|
|
327
|
+
static SHEAR: number;
|
|
328
|
+
/** The index of the transform constraint slot in {@link Skeleton#transformConstraints} that will be changed. */
|
|
329
|
+
transformConstraintIndex: number;
|
|
330
|
+
/** The time in seconds, rotate mix, translate mix, scale mix, and shear mix for each key frame. */
|
|
331
|
+
frames: ArrayLike<number>;
|
|
332
|
+
constructor(frameCount: number);
|
|
333
|
+
getPropertyId(): number;
|
|
334
|
+
/** The time in seconds, rotate mix, translate mix, scale mix, and shear mix for the specified key frame. */
|
|
335
|
+
setFrame(frameIndex: number, time: number, rotateMix: number, translateMix: number, scaleMix: number, shearMix: number): void;
|
|
336
|
+
apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection): void;
|
|
337
|
+
}
|
|
338
|
+
/** Changes a path constraint's {@link PathConstraint#position}. */
|
|
339
|
+
export declare class PathConstraintPositionTimeline extends CurveTimeline {
|
|
340
|
+
static ENTRIES: number;
|
|
341
|
+
static PREV_TIME: number;
|
|
342
|
+
static PREV_VALUE: number;
|
|
343
|
+
static VALUE: number;
|
|
344
|
+
/** The index of the path constraint slot in {@link Skeleton#pathConstraints} that will be changed. */
|
|
345
|
+
pathConstraintIndex: number;
|
|
346
|
+
/** The time in seconds and path constraint position for each key frame. */
|
|
347
|
+
frames: ArrayLike<number>;
|
|
348
|
+
constructor(frameCount: number);
|
|
349
|
+
getPropertyId(): number;
|
|
350
|
+
/** Sets the time in seconds and path constraint position for the specified key frame. */
|
|
351
|
+
setFrame(frameIndex: number, time: number, value: number): void;
|
|
352
|
+
apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection): void;
|
|
353
|
+
}
|
|
354
|
+
/** Changes a path constraint's {@link PathConstraint#spacing}. */
|
|
355
|
+
export declare class PathConstraintSpacingTimeline extends PathConstraintPositionTimeline {
|
|
356
|
+
constructor(frameCount: number);
|
|
357
|
+
getPropertyId(): number;
|
|
358
|
+
apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection): void;
|
|
359
|
+
}
|
|
360
|
+
/** Changes a transform constraint's {@link PathConstraint#rotateMix} and
|
|
361
|
+
* {@link TransformConstraint#translateMix}. */
|
|
362
|
+
export declare class PathConstraintMixTimeline extends CurveTimeline {
|
|
363
|
+
static ENTRIES: number;
|
|
364
|
+
static PREV_TIME: number;
|
|
365
|
+
static PREV_ROTATE: number;
|
|
366
|
+
static PREV_TRANSLATE: number;
|
|
367
|
+
static ROTATE: number;
|
|
368
|
+
static TRANSLATE: number;
|
|
369
|
+
/** The index of the path constraint slot in {@link Skeleton#getPathConstraints()} that will be changed. */
|
|
370
|
+
pathConstraintIndex: number;
|
|
371
|
+
/** The time in seconds, rotate mix, and translate mix for each key frame. */
|
|
372
|
+
frames: ArrayLike<number>;
|
|
373
|
+
constructor(frameCount: number);
|
|
374
|
+
getPropertyId(): number;
|
|
375
|
+
/** The time in seconds, rotate mix, and translate mix for the specified key frame. */
|
|
376
|
+
setFrame(frameIndex: number, time: number, rotateMix: number, translateMix: number): void;
|
|
377
|
+
apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection): void;
|
|
378
|
+
}
|