@galacean/engine-spine 4.2.5 → 4.2.6

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.
Files changed (60) hide show
  1. package/dist/browser.js +1 -1
  2. package/dist/main.js +96 -16
  3. package/dist/main.js.map +1 -1
  4. package/dist/miniprogram.js +96 -16
  5. package/dist/module.js +96 -16
  6. package/dist/module.js.map +1 -1
  7. package/package.json +1 -1
  8. package/types/AntGSpineLoader.d.ts +22 -0
  9. package/types/SpineAnimation.d.ts +45 -0
  10. package/types/SpineLoader.d.ts +32 -0
  11. package/types/SpineMaterial.d.ts +6 -0
  12. package/types/SpineRenderer.d.ts +38 -0
  13. package/types/core/MeshGenerator.d.ts +43 -0
  14. package/types/core/SpineMesh.d.ts +11 -0
  15. package/types/spine-core/Animation.d.ts +378 -0
  16. package/types/spine-core/AnimationState.d.ts +365 -0
  17. package/types/spine-core/AnimationStateData.d.ts +23 -0
  18. package/types/spine-core/AssetManager.d.ts +36 -0
  19. package/types/spine-core/AtlasAttachmentLoader.d.ts +23 -0
  20. package/types/spine-core/BlendMode.d.ts +7 -0
  21. package/types/spine-core/Bone.d.ts +110 -0
  22. package/types/spine-core/BoneData.d.ts +44 -0
  23. package/types/spine-core/ConstraintData.d.ts +7 -0
  24. package/types/spine-core/Event.d.ts +16 -0
  25. package/types/spine-core/EventData.d.ts +13 -0
  26. package/types/spine-core/IkConstraint.d.ts +38 -0
  27. package/types/spine-core/IkConstraintData.d.ts +26 -0
  28. package/types/spine-core/PathConstraint.d.ts +46 -0
  29. package/types/spine-core/PathConstraintData.d.ts +52 -0
  30. package/types/spine-core/SharedAssetManager.d.ts +19 -0
  31. package/types/spine-core/Skeleton.d.ts +134 -0
  32. package/types/spine-core/SkeletonBinary.d.ts +49 -0
  33. package/types/spine-core/SkeletonBounds.d.ts +48 -0
  34. package/types/spine-core/SkeletonClipping.d.ts +22 -0
  35. package/types/spine-core/SkeletonData.d.ts +89 -0
  36. package/types/spine-core/SkeletonJson.d.ts +34 -0
  37. package/types/spine-core/Skin.d.ts +43 -0
  38. package/types/spine-core/Slot.d.ts +42 -0
  39. package/types/spine-core/SlotData.d.ts +23 -0
  40. package/types/spine-core/Texture.d.ts +46 -0
  41. package/types/spine-core/TextureAtlas.d.ts +30 -0
  42. package/types/spine-core/TransformConstraint.d.ts +36 -0
  43. package/types/spine-core/TransformConstraintData.d.ts +34 -0
  44. package/types/spine-core/Triangulator.d.ts +14 -0
  45. package/types/spine-core/Updatable.d.ts +9 -0
  46. package/types/spine-core/Utils.d.ts +124 -0
  47. package/types/spine-core/VertexEffect.d.ts +7 -0
  48. package/types/spine-core/attachments/Attachment.d.ts +43 -0
  49. package/types/spine-core/attachments/AttachmentLoader.d.ts +25 -0
  50. package/types/spine-core/attachments/AttachmentType.d.ts +9 -0
  51. package/types/spine-core/attachments/BoundingBoxAttachment.d.ts +12 -0
  52. package/types/spine-core/attachments/ClippingAttachment.d.ts +14 -0
  53. package/types/spine-core/attachments/MeshAttachment.d.ts +46 -0
  54. package/types/spine-core/attachments/PathAttachment.d.ts +19 -0
  55. package/types/spine-core/attachments/PointAttachment.d.ts +20 -0
  56. package/types/spine-core/attachments/RegionAttachment.d.ts +88 -0
  57. package/types/spine-core/polyfills.d.ts +3 -0
  58. package/types/spine-core/vertexeffects/JitterEffect.d.ts +11 -0
  59. package/types/spine-core/vertexeffects/SwirlEffect.d.ts +16 -0
  60. package/types/types.d.ts +4 -0
@@ -0,0 +1,23 @@
1
+ import { BoneData } from "./BoneData";
2
+ import { Color } from "./Utils";
3
+ import { BlendMode } from "./BlendMode";
4
+ /** Stores the setup pose for a {@link Slot}. */
5
+ export declare class SlotData {
6
+ /** The index of the slot in {@link Skeleton#getSlots()}. */
7
+ index: number;
8
+ /** The name of the slot, which is unique across all slots in the skeleton. */
9
+ name: string;
10
+ /** The bone this slot belongs to. */
11
+ boneData: BoneData;
12
+ /** The color used to tint the slot's attachment. If {@link #getDarkColor()} is set, this is used as the light color for two
13
+ * color tinting. */
14
+ color: Color;
15
+ /** The dark color used to tint the slot's attachment for two color tinting, or null if two color tinting is not used. The dark
16
+ * color's alpha is not used. */
17
+ darkColor: Color;
18
+ /** The name of the attachment that is visible for this slot in the setup pose, or null if no attachment is visible. */
19
+ attachmentName: string;
20
+ /** The blend mode for drawing the slot's attachment. */
21
+ blendMode: BlendMode;
22
+ constructor(index: number, name: string, boneData: BoneData);
23
+ }
@@ -0,0 +1,46 @@
1
+ import { Texture2D } from "@galacean/engine";
2
+ export declare abstract class Texture {
3
+ protected _texture: Texture2D;
4
+ constructor(texture: Texture2D);
5
+ get width(): number;
6
+ get height(): number;
7
+ get texture(): Texture2D;
8
+ abstract setFilters(minFilter: TextureFilter, magFilter: TextureFilter): void;
9
+ abstract setWraps(uWrap: TextureWrap, vWrap: TextureWrap): void;
10
+ abstract dispose(): void;
11
+ static filterFromString(text: string): TextureFilter;
12
+ static wrapFromString(text: string): TextureWrap;
13
+ }
14
+ export declare enum TextureFilter {
15
+ Nearest = 9728,
16
+ Linear = 9729,
17
+ MipMap = 9987,
18
+ MipMapNearestNearest = 9984,
19
+ MipMapLinearNearest = 9985,
20
+ MipMapNearestLinear = 9986,
21
+ MipMapLinearLinear = 9987
22
+ }
23
+ export declare enum TextureWrap {
24
+ MirroredRepeat = 33648,
25
+ ClampToEdge = 33071,
26
+ Repeat = 10497
27
+ }
28
+ export declare class TextureRegion {
29
+ renderObject: any;
30
+ u: number;
31
+ v: number;
32
+ u2: number;
33
+ v2: number;
34
+ width: number;
35
+ height: number;
36
+ rotate: boolean;
37
+ offsetX: number;
38
+ offsetY: number;
39
+ originalWidth: number;
40
+ originalHeight: number;
41
+ }
42
+ export declare class FakeTexture extends Texture {
43
+ setFilters(minFilter: TextureFilter, magFilter: TextureFilter): void;
44
+ setWraps(uWrap: TextureWrap, vWrap: TextureWrap): void;
45
+ dispose(): void;
46
+ }
@@ -0,0 +1,30 @@
1
+ import { Disposable } from "./Utils";
2
+ import { Texture, TextureFilter } from "./Texture";
3
+ import { TextureWrap, TextureRegion } from "./Texture";
4
+ export declare class TextureAtlas implements Disposable {
5
+ pages: TextureAtlasPage[];
6
+ regions: TextureAtlasRegion[];
7
+ constructor(atlasText: string, textureLoader: (path: string, width?: number, height?: number) => any);
8
+ private load;
9
+ findRegion(name: string): TextureAtlasRegion;
10
+ dispose(): void;
11
+ }
12
+ export declare class TextureAtlasPage {
13
+ name: string;
14
+ minFilter: TextureFilter;
15
+ magFilter: TextureFilter;
16
+ uWrap: TextureWrap;
17
+ vWrap: TextureWrap;
18
+ texture: Texture;
19
+ width: number;
20
+ height: number;
21
+ }
22
+ export declare class TextureAtlasRegion extends TextureRegion {
23
+ page: TextureAtlasPage;
24
+ name: string;
25
+ x: number;
26
+ y: number;
27
+ index: number;
28
+ degrees: number;
29
+ texture: Texture;
30
+ }
@@ -0,0 +1,36 @@
1
+ import { Updatable } from "./Updatable";
2
+ import { TransformConstraintData } from "./TransformConstraintData";
3
+ import { Bone } from "./Bone";
4
+ import { Skeleton } from "./Skeleton";
5
+ import { Vector2 } from "./Utils";
6
+ /** Stores the current pose for a transform constraint. A transform constraint adjusts the world transform of the constrained
7
+ * bones to match that of the target bone.
8
+ *
9
+ * See [Transform constraints](http://esotericsoftware.com/spine-transform-constraints) in the Spine User Guide. */
10
+ export declare class TransformConstraint implements Updatable {
11
+ /** The transform constraint's setup pose data. */
12
+ data: TransformConstraintData;
13
+ /** The bones that will be modified by this transform constraint. */
14
+ bones: Array<Bone>;
15
+ /** The target bone whose world transform will be copied to the constrained bones. */
16
+ target: Bone;
17
+ /** A percentage (0-1) that controls the mix between the constrained and unconstrained rotations. */
18
+ rotateMix: number;
19
+ /** A percentage (0-1) that controls the mix between the constrained and unconstrained translations. */
20
+ translateMix: number;
21
+ /** A percentage (0-1) that controls the mix between the constrained and unconstrained scales. */
22
+ scaleMix: number;
23
+ /** A percentage (0-1) that controls the mix between the constrained and unconstrained scales. */
24
+ shearMix: number;
25
+ temp: Vector2;
26
+ active: boolean;
27
+ constructor(data: TransformConstraintData, skeleton: Skeleton);
28
+ isActive(): boolean;
29
+ /** Applies the constraint to the constrained bones. */
30
+ apply(): void;
31
+ update(): void;
32
+ applyAbsoluteWorld(): void;
33
+ applyRelativeWorld(): void;
34
+ applyAbsoluteLocal(): void;
35
+ applyRelativeLocal(): void;
36
+ }
@@ -0,0 +1,34 @@
1
+ import { ConstraintData } from "./ConstraintData";
2
+ import { BoneData } from "./BoneData";
3
+ /** Stores the setup pose for a {@link TransformConstraint}.
4
+ *
5
+ * See [Transform constraints](http://esotericsoftware.com/spine-transform-constraints) in the Spine User Guide. */
6
+ export declare class TransformConstraintData extends ConstraintData {
7
+ /** The bones that will be modified by this transform constraint. */
8
+ bones: BoneData[];
9
+ /** The target bone whose world transform will be copied to the constrained bones. */
10
+ target: BoneData;
11
+ /** A percentage (0-1) that controls the mix between the constrained and unconstrained rotations. */
12
+ rotateMix: number;
13
+ /** A percentage (0-1) that controls the mix between the constrained and unconstrained translations. */
14
+ translateMix: number;
15
+ /** A percentage (0-1) that controls the mix between the constrained and unconstrained scales. */
16
+ scaleMix: number;
17
+ /** A percentage (0-1) that controls the mix between the constrained and unconstrained shears. */
18
+ shearMix: number;
19
+ /** An offset added to the constrained bone rotation. */
20
+ offsetRotation: number;
21
+ /** An offset added to the constrained bone X translation. */
22
+ offsetX: number;
23
+ /** An offset added to the constrained bone Y translation. */
24
+ offsetY: number;
25
+ /** An offset added to the constrained bone scaleX. */
26
+ offsetScaleX: number;
27
+ /** An offset added to the constrained bone scaleY. */
28
+ offsetScaleY: number;
29
+ /** An offset added to the constrained bone shearY. */
30
+ offsetShearY: number;
31
+ relative: boolean;
32
+ local: boolean;
33
+ constructor(name: string);
34
+ }
@@ -0,0 +1,14 @@
1
+ export declare class Triangulator {
2
+ private convexPolygons;
3
+ private convexPolygonsIndices;
4
+ private indicesArray;
5
+ private isConcaveArray;
6
+ private triangles;
7
+ private polygonPool;
8
+ private polygonIndicesPool;
9
+ triangulate(verticesArray: ArrayLike<number>): Array<number>;
10
+ decompose(verticesArray: Array<number>, triangles: Array<number>): Array<Array<number>>;
11
+ private static isConcave;
12
+ private static positiveArea;
13
+ private static winding;
14
+ }
@@ -0,0 +1,9 @@
1
+ /** The interface for items updated by {@link Skeleton#updateWorldTransform()}. */
2
+ export interface Updatable {
3
+ update(): void;
4
+ /** Returns false when this item has not been updated because a skin is required and the {@link Skeleton#skin active skin}
5
+ * does not contain this item.
6
+ * @see Skin#getBones()
7
+ * @see Skin#getConstraints() */
8
+ isActive(): boolean;
9
+ }
@@ -0,0 +1,124 @@
1
+ import { MixBlend } from "./Animation";
2
+ import { Skeleton } from "./Skeleton";
3
+ export interface Map<T> {
4
+ [key: string]: T;
5
+ }
6
+ export declare class IntSet {
7
+ array: number[];
8
+ add(value: number): boolean;
9
+ contains(value: number): boolean;
10
+ remove(value: number): void;
11
+ clear(): void;
12
+ }
13
+ export interface Disposable {
14
+ dispose(): void;
15
+ }
16
+ export interface Restorable {
17
+ restore(): void;
18
+ }
19
+ export declare class Color {
20
+ r: number;
21
+ g: number;
22
+ b: number;
23
+ a: number;
24
+ static WHITE: Color;
25
+ static RED: Color;
26
+ static GREEN: Color;
27
+ static BLUE: Color;
28
+ static MAGENTA: Color;
29
+ constructor(r?: number, g?: number, b?: number, a?: number);
30
+ set(r: number, g: number, b: number, a: number): this;
31
+ setFromColor(c: Color): this;
32
+ setFromString(hex: string): this;
33
+ add(r: number, g: number, b: number, a: number): this;
34
+ clamp(): this;
35
+ static rgba8888ToColor(color: Color, value: number): void;
36
+ static rgb888ToColor(color: Color, value: number): void;
37
+ }
38
+ export declare class MathUtils {
39
+ static PI: number;
40
+ static PI2: number;
41
+ static radiansToDegrees: number;
42
+ static radDeg: number;
43
+ static degreesToRadians: number;
44
+ static degRad: number;
45
+ static clamp(value: number, min: number, max: number): number;
46
+ static cosDeg(degrees: number): number;
47
+ static sinDeg(degrees: number): number;
48
+ static signum(value: number): number;
49
+ static toInt(x: number): number;
50
+ static cbrt(x: number): number;
51
+ static randomTriangular(min: number, max: number): number;
52
+ static randomTriangularWith(min: number, max: number, mode: number): number;
53
+ }
54
+ export declare abstract class Interpolation {
55
+ protected abstract applyInternal(a: number): number;
56
+ apply(start: number, end: number, a: number): number;
57
+ }
58
+ export declare class Pow extends Interpolation {
59
+ protected power: number;
60
+ constructor(power: number);
61
+ applyInternal(a: number): number;
62
+ }
63
+ export declare class PowOut extends Pow {
64
+ constructor(power: number);
65
+ applyInternal(a: number): number;
66
+ }
67
+ export declare class Utils {
68
+ static SUPPORTS_TYPED_ARRAYS: boolean;
69
+ static arrayCopy<T>(source: ArrayLike<T>, sourceStart: number, dest: ArrayLike<T>, destStart: number, numElements: number): void;
70
+ static setArraySize<T>(array: Array<T>, size: number, value?: any): Array<T>;
71
+ static ensureArrayCapacity<T>(array: Array<T>, size: number, value?: any): Array<T>;
72
+ static newArray<T>(size: number, defaultValue: T): Array<T>;
73
+ static newFloatArray(size: number): ArrayLike<number>;
74
+ static newShortArray(size: number): ArrayLike<number>;
75
+ static toFloatArray(array: Array<number>): number[] | Float32Array;
76
+ static toSinglePrecision(value: number): number;
77
+ static webkit602BugfixHelper(alpha: number, blend: MixBlend): void;
78
+ static contains<T>(array: Array<T>, element: T, identity?: boolean): boolean;
79
+ }
80
+ export declare class DebugUtils {
81
+ static logBones(skeleton: Skeleton): void;
82
+ }
83
+ export declare class Pool<T> {
84
+ private items;
85
+ private instantiator;
86
+ constructor(instantiator: () => T);
87
+ obtain(): T;
88
+ free(item: T): void;
89
+ freeAll(items: ArrayLike<T>): void;
90
+ clear(): void;
91
+ }
92
+ export declare class Vector2 {
93
+ x: number;
94
+ y: number;
95
+ constructor(x?: number, y?: number);
96
+ set(x: number, y: number): Vector2;
97
+ length(): number;
98
+ normalize(): this;
99
+ }
100
+ export declare class TimeKeeper {
101
+ maxDelta: number;
102
+ framesPerSecond: number;
103
+ delta: number;
104
+ totalTime: number;
105
+ private lastTime;
106
+ private frameCount;
107
+ private frameTime;
108
+ update(): void;
109
+ }
110
+ export interface ArrayLike<T> {
111
+ length: number;
112
+ [n: number]: T;
113
+ }
114
+ export declare class WindowedMean {
115
+ values: Array<number>;
116
+ addedValues: number;
117
+ lastValue: number;
118
+ mean: number;
119
+ dirty: boolean;
120
+ constructor(windowSize?: number);
121
+ hasEnoughData(): boolean;
122
+ addValue(value: number): void;
123
+ getMean(): number;
124
+ }
@@ -0,0 +1,7 @@
1
+ import { Skeleton } from "./Skeleton";
2
+ import { Color, Vector2 } from "./Utils";
3
+ export interface VertexEffect {
4
+ begin(skeleton: Skeleton): void;
5
+ transform(position: Vector2, uv: Vector2, light: Color, dark: Color): void;
6
+ end(): void;
7
+ }
@@ -0,0 +1,43 @@
1
+ import { Slot } from "../Slot";
2
+ import { ArrayLike } from "../Utils";
3
+ /** The base class for all attachments. */
4
+ export declare abstract class Attachment {
5
+ name: string;
6
+ constructor(name: string);
7
+ abstract copy(): Attachment;
8
+ }
9
+ /** Base class for an attachment with vertices that are transformed by one or more bones and can be deformed by a slot's
10
+ * {@link Slot#deform}. */
11
+ export declare abstract class VertexAttachment extends Attachment {
12
+ private static nextID;
13
+ /** The unique ID for this attachment. */
14
+ id: number;
15
+ /** The bones which affect the {@link #getVertices()}. The array entries are, for each vertex, the number of bones affecting
16
+ * the vertex followed by that many bone indices, which is the index of the bone in {@link Skeleton#bones}. Will be null
17
+ * if this attachment has no weights. */
18
+ bones: Array<number>;
19
+ /** The vertex positions in the bone's coordinate system. For a non-weighted attachment, the values are `x,y`
20
+ * entries for each vertex. For a weighted attachment, the values are `x,y,weight` entries for each bone affecting
21
+ * each vertex. */
22
+ vertices: ArrayLike<number>;
23
+ /** The maximum number of world vertex values that can be output by
24
+ * {@link #computeWorldVertices()} using the `count` parameter. */
25
+ worldVerticesLength: number;
26
+ /** Deform keys for the deform attachment are also applied to this attachment. May be null if no deform keys should be applied. */
27
+ deformAttachment: VertexAttachment;
28
+ constructor(name: string);
29
+ /** Transforms the attachment's local {@link vertices} to world coordinates. If the slot's {@link Slot#deform} is
30
+ * not empty, it is used to deform the vertices.
31
+ *
32
+ * See [World transforms](http://esotericsoftware.com/spine-runtime-skeletons#World-transforms) in the Spine
33
+ * Runtimes Guide.
34
+ * @param start The index of the first {@link #vertices} value to transform. Each vertex has 2 values, x and y.
35
+ * @param count The number of world vertex values to output. Must be <= {@link #worldVerticesLength} - `start`.
36
+ * @param worldVertices The output world vertices. Must have a length >= `offset` + `count` *
37
+ * `stride` / 2.
38
+ * @param offset The `worldVertices` index to begin writing values.
39
+ * @param stride The number of `worldVertices` entries between the value pairs written. */
40
+ computeWorldVertices(slot: Slot, start: number, count: number, worldVertices: ArrayLike<number>, offset: number, stride: number): void;
41
+ /** Does not copy id (generated) or name (set on construction). **/
42
+ copyTo(attachment: VertexAttachment): void;
43
+ }
@@ -0,0 +1,25 @@
1
+ import { RegionAttachment } from "./RegionAttachment";
2
+ import { Skin } from "../Skin";
3
+ import { BoundingBoxAttachment } from "./BoundingBoxAttachment";
4
+ import { PathAttachment } from "./PathAttachment";
5
+ import { PointAttachment } from "./PointAttachment";
6
+ import { ClippingAttachment } from "./ClippingAttachment";
7
+ import { MeshAttachment } from "./MeshAttachment";
8
+ /** The interface which can be implemented to customize creating and populating attachments.
9
+ *
10
+ * See [Loading skeleton data](http://esotericsoftware.com/spine-loading-skeleton-data#AttachmentLoader) in the Spine
11
+ * Runtimes Guide. */
12
+ export interface AttachmentLoader {
13
+ /** @return May be null to not load an attachment. */
14
+ newRegionAttachment(skin: Skin, name: string, path: string): RegionAttachment;
15
+ /** @return May be null to not load an attachment. */
16
+ newMeshAttachment(skin: Skin, name: string, path: string): MeshAttachment;
17
+ /** @return May be null to not load an attachment. */
18
+ newBoundingBoxAttachment(skin: Skin, name: string): BoundingBoxAttachment;
19
+ /** @return May be null to not load an attachment */
20
+ newPathAttachment(skin: Skin, name: string): PathAttachment;
21
+ /** @return May be null to not load an attachment */
22
+ newPointAttachment(skin: Skin, name: string): PointAttachment;
23
+ /** @return May be null to not load an attachment */
24
+ newClippingAttachment(skin: Skin, name: string): ClippingAttachment;
25
+ }
@@ -0,0 +1,9 @@
1
+ export declare enum AttachmentType {
2
+ Region = 0,
3
+ BoundingBox = 1,
4
+ Mesh = 2,
5
+ LinkedMesh = 3,
6
+ Path = 4,
7
+ Point = 5,
8
+ Clipping = 6
9
+ }
@@ -0,0 +1,12 @@
1
+ import { VertexAttachment, Attachment } from "./Attachment";
2
+ import { Color } from "../Utils";
3
+ /** An attachment with vertices that make up a polygon. Can be used for hit detection, creating physics bodies, spawning particle
4
+ * effects, and more.
5
+ *
6
+ * See {@link SkeletonBounds} and [Bounding Boxes](http://esotericsoftware.com/spine-bounding-boxes) in the Spine User
7
+ * Guide. */
8
+ export declare class BoundingBoxAttachment extends VertexAttachment {
9
+ color: Color;
10
+ constructor(name: string);
11
+ copy(): Attachment;
12
+ }
@@ -0,0 +1,14 @@
1
+ import { VertexAttachment, Attachment } from "./Attachment";
2
+ import { SlotData } from "../SlotData";
3
+ import { Color } from "../Utils";
4
+ /** An attachment with vertices that make up a polygon used for clipping the rendering of other attachments. */
5
+ export declare class ClippingAttachment extends VertexAttachment {
6
+ /** Clipping is performed between the clipping polygon's slot and the end slot. Returns null if clipping is done until the end of
7
+ * the skeleton's rendering. */
8
+ endSlot: SlotData;
9
+ /** The color of the clipping polygon as it was in Spine. Available only when nonessential data was exported. Clipping polygons
10
+ * are not usually rendered at runtime. */
11
+ color: Color;
12
+ constructor(name: string);
13
+ copy(): Attachment;
14
+ }
@@ -0,0 +1,46 @@
1
+ import { VertexAttachment, Attachment } from "./Attachment";
2
+ import { TextureRegion } from "../Texture";
3
+ import { Color, ArrayLike } from "../Utils";
4
+ /** An attachment that displays a textured mesh. A mesh has hull vertices and internal vertices within the hull. Holes are not
5
+ * supported. Each vertex has UVs (texture coordinates) and triangles are used to map an image on to the mesh.
6
+ *
7
+ * See [Mesh attachments](http://esotericsoftware.com/spine-meshes) in the Spine User Guide. */
8
+ export declare class MeshAttachment extends VertexAttachment {
9
+ region: TextureRegion;
10
+ /** The name of the texture region for this attachment. */
11
+ path: string;
12
+ /** The UV pair for each vertex, normalized within the texture region. */
13
+ regionUVs: ArrayLike<number>;
14
+ /** The UV pair for each vertex, normalized within the entire texture.
15
+ *
16
+ * See {@link #updateUVs}. */
17
+ uvs: ArrayLike<number>;
18
+ /** Triplets of vertex indices which describe the mesh's triangulation. */
19
+ triangles: Array<number>;
20
+ /** The color to tint the mesh. */
21
+ color: Color;
22
+ /** The width of the mesh's image. Available only when nonessential data was exported. */
23
+ width: number;
24
+ /** The height of the mesh's image. Available only when nonessential data was exported. */
25
+ height: number;
26
+ /** The number of entries at the beginning of {@link #vertices} that make up the mesh hull. */
27
+ hullLength: number;
28
+ /** Vertex index pairs describing edges for controling triangulation. Mesh triangles will never cross edges. Only available if
29
+ * nonessential data was exported. Triangulation is not performed at runtime. */
30
+ edges: Array<number>;
31
+ private parentMesh;
32
+ tempColor: Color;
33
+ constructor(name: string);
34
+ /** Calculates {@link #uvs} using {@link #regionUVs} and the {@link #region}. Must be called after changing the region UVs or
35
+ * region. */
36
+ updateUVs(): void;
37
+ /** The parent mesh if this is a linked mesh, else null. A linked mesh shares the {@link #bones}, {@link #vertices},
38
+ * {@link #regionUVs}, {@link #triangles}, {@link #hullLength}, {@link #edges}, {@link #width}, and {@link #height} with the
39
+ * parent mesh, but may have a different {@link #name} or {@link #path} (and therefore a different texture). */
40
+ getParentMesh(): MeshAttachment;
41
+ /** @param parentMesh May be null. */
42
+ setParentMesh(parentMesh: MeshAttachment): void;
43
+ copy(): Attachment;
44
+ /** Returns a new mesh with the {@link #parentMesh} set to this mesh's parent mesh, if any, else to this mesh. **/
45
+ newLinkedMesh(): MeshAttachment;
46
+ }
@@ -0,0 +1,19 @@
1
+ import { VertexAttachment, Attachment } from "./Attachment";
2
+ import { Color } from "../Utils";
3
+ /** An attachment whose vertices make up a composite Bezier curve.
4
+ *
5
+ * See {@link PathConstraint} and [Paths](http://esotericsoftware.com/spine-paths) in the Spine User Guide. */
6
+ export declare class PathAttachment extends VertexAttachment {
7
+ /** The lengths along the path in the setup pose from the start of the path to the end of each Bezier curve. */
8
+ lengths: Array<number>;
9
+ /** If true, the start and end knots are connected. */
10
+ closed: boolean;
11
+ /** If true, additional calculations are performed to make calculating positions along the path more accurate. If false, fewer
12
+ * calculations are performed but calculating positions along the path is less accurate. */
13
+ constantSpeed: boolean;
14
+ /** The color of the path as it was in Spine. Available only when nonessential data was exported. Paths are not usually
15
+ * rendered at runtime. */
16
+ color: Color;
17
+ constructor(name: string);
18
+ copy(): Attachment;
19
+ }
@@ -0,0 +1,20 @@
1
+ import { VertexAttachment, Attachment } from "./Attachment";
2
+ import { Color, Vector2 } from "../Utils";
3
+ import { Bone } from "../Bone";
4
+ /** An attachment which is a single point and a rotation. This can be used to spawn projectiles, particles, etc. A bone can be
5
+ * used in similar ways, but a PointAttachment is slightly less expensive to compute and can be hidden, shown, and placed in a
6
+ * skin.
7
+ *
8
+ * See [Point Attachments](http://esotericsoftware.com/spine-point-attachments) in the Spine User Guide. */
9
+ export declare class PointAttachment extends VertexAttachment {
10
+ x: number;
11
+ y: number;
12
+ rotation: number;
13
+ /** The color of the point attachment as it was in Spine. Available only when nonessential data was exported. Point attachments
14
+ * are not usually rendered at runtime. */
15
+ color: Color;
16
+ constructor(name: string);
17
+ computeWorldPosition(bone: Bone, point: Vector2): Vector2;
18
+ computeWorldRotation(bone: Bone): number;
19
+ copy(): Attachment;
20
+ }
@@ -0,0 +1,88 @@
1
+ import { Attachment } from "./Attachment";
2
+ import { Color, ArrayLike } from "../Utils";
3
+ import { TextureRegion } from "../Texture";
4
+ import { Bone } from "../Bone";
5
+ /** An attachment that displays a textured quadrilateral.
6
+ *
7
+ * See [Region attachments](http://esotericsoftware.com/spine-regions) in the Spine User Guide. */
8
+ export declare class RegionAttachment extends Attachment {
9
+ static OX1: number;
10
+ static OY1: number;
11
+ static OX2: number;
12
+ static OY2: number;
13
+ static OX3: number;
14
+ static OY3: number;
15
+ static OX4: number;
16
+ static OY4: number;
17
+ static X1: number;
18
+ static Y1: number;
19
+ static C1R: number;
20
+ static C1G: number;
21
+ static C1B: number;
22
+ static C1A: number;
23
+ static U1: number;
24
+ static V1: number;
25
+ static X2: number;
26
+ static Y2: number;
27
+ static C2R: number;
28
+ static C2G: number;
29
+ static C2B: number;
30
+ static C2A: number;
31
+ static U2: number;
32
+ static V2: number;
33
+ static X3: number;
34
+ static Y3: number;
35
+ static C3R: number;
36
+ static C3G: number;
37
+ static C3B: number;
38
+ static C3A: number;
39
+ static U3: number;
40
+ static V3: number;
41
+ static X4: number;
42
+ static Y4: number;
43
+ static C4R: number;
44
+ static C4G: number;
45
+ static C4B: number;
46
+ static C4A: number;
47
+ static U4: number;
48
+ static V4: number;
49
+ /** The local x translation. */
50
+ x: number;
51
+ /** The local y translation. */
52
+ y: number;
53
+ /** The local scaleX. */
54
+ scaleX: number;
55
+ /** The local scaleY. */
56
+ scaleY: number;
57
+ /** The local rotation. */
58
+ rotation: number;
59
+ /** The width of the region attachment in Spine. */
60
+ width: number;
61
+ /** The height of the region attachment in Spine. */
62
+ height: number;
63
+ /** The color to tint the region attachment. */
64
+ color: Color;
65
+ /** The name of the texture region for this attachment. */
66
+ path: string;
67
+ rendererObject: any;
68
+ region: TextureRegion;
69
+ /** For each of the 4 vertices, a pair of <code>x,y</code> values that is the local position of the vertex.
70
+ *
71
+ * See {@link #updateOffset()}. */
72
+ offset: ArrayLike<number>;
73
+ uvs: ArrayLike<number>;
74
+ tempColor: Color;
75
+ constructor(name: string);
76
+ /** Calculates the {@link #offset} using the region settings. Must be called after changing region settings. */
77
+ updateOffset(): void;
78
+ setRegion(region: TextureRegion): void;
79
+ /** Transforms the attachment's four vertices to world coordinates.
80
+ *
81
+ * See [World transforms](http://esotericsoftware.com/spine-runtime-skeletons#World-transforms) in the Spine
82
+ * Runtimes Guide.
83
+ * @param worldVertices The output world vertices. Must have a length >= `offset` + 8.
84
+ * @param offset The `worldVertices` index to begin writing values.
85
+ * @param stride The number of `worldVertices` entries between the value pairs written. */
86
+ computeWorldVertices(bone: Bone, worldVertices: ArrayLike<number>, offset: number, stride: number): void;
87
+ copy(): Attachment;
88
+ }
@@ -0,0 +1,3 @@
1
+ interface Math {
2
+ fround(n: number): number;
3
+ }
@@ -0,0 +1,11 @@
1
+ import { VertexEffect } from "../VertexEffect";
2
+ import { Skeleton } from "../Skeleton";
3
+ import { Color, Vector2 } from "../Utils";
4
+ export declare class JitterEffect implements VertexEffect {
5
+ jitterX: number;
6
+ jitterY: number;
7
+ constructor(jitterX: number, jitterY: number);
8
+ begin(skeleton: Skeleton): void;
9
+ transform(position: Vector2, uv: Vector2, light: Color, dark: Color): void;
10
+ end(): void;
11
+ }
@@ -0,0 +1,16 @@
1
+ import { VertexEffect } from "../VertexEffect";
2
+ import { PowOut, Color, Vector2 } from "../Utils";
3
+ import { Skeleton } from "../Skeleton";
4
+ export declare class SwirlEffect implements VertexEffect {
5
+ static interpolation: PowOut;
6
+ centerX: number;
7
+ centerY: number;
8
+ radius: number;
9
+ angle: number;
10
+ private worldX;
11
+ private worldY;
12
+ constructor(radius: number);
13
+ begin(skeleton: Skeleton): void;
14
+ transform(position: Vector2, uv: Vector2, light: Color, dark: Color): void;
15
+ end(): void;
16
+ }
@@ -0,0 +1,4 @@
1
+ export type SpineRenderSetting = {
2
+ useClipping: boolean;
3
+ zSpacing: number;
4
+ };