@esotericsoftware/spine-pixi-v8 4.2.71 → 4.2.72
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/Spine.d.ts +67 -1
- package/dist/Spine.js +152 -7
- package/dist/esm/spine-pixi-v8.min.mjs +3 -3
- package/dist/esm/spine-pixi-v8.mjs +131 -9
- package/dist/esm/spine-pixi-v8.mjs.map +3 -3
- package/dist/iife/spine-pixi-v8.js +131 -9
- package/dist/iife/spine-pixi-v8.js.map +3 -3
- package/dist/iife/spine-pixi-v8.min.js +3 -3
- package/package.json +2 -2
package/dist/Spine.d.ts
CHANGED
|
@@ -47,6 +47,66 @@ export interface SpineFromOptions {
|
|
|
47
47
|
* If `undefined`, use the dark tint renderer if at least one slot has tint black
|
|
48
48
|
*/
|
|
49
49
|
darkTint?: boolean;
|
|
50
|
+
/** The bounds provider to use. If undefined the bounds will be dynamic, calculated when requested and based on the current frame. */
|
|
51
|
+
boundsProvider?: SpineBoundsProvider;
|
|
52
|
+
}
|
|
53
|
+
/** A bounds provider calculates the bounding box for a skeleton, which is then assigned as the size of the SpineGameObject. */
|
|
54
|
+
export interface SpineBoundsProvider {
|
|
55
|
+
/** Returns the bounding box for the skeleton, in skeleton space. */
|
|
56
|
+
calculateBounds(gameObject: Spine): {
|
|
57
|
+
x: number;
|
|
58
|
+
y: number;
|
|
59
|
+
width: number;
|
|
60
|
+
height: number;
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
/** A bounds provider that provides a fixed size given by the user. */
|
|
64
|
+
export declare class AABBRectangleBoundsProvider implements SpineBoundsProvider {
|
|
65
|
+
private x;
|
|
66
|
+
private y;
|
|
67
|
+
private width;
|
|
68
|
+
private height;
|
|
69
|
+
constructor(x: number, y: number, width: number, height: number);
|
|
70
|
+
calculateBounds(): {
|
|
71
|
+
x: number;
|
|
72
|
+
y: number;
|
|
73
|
+
width: number;
|
|
74
|
+
height: number;
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
/** A bounds provider that calculates the bounding box from the setup pose. */
|
|
78
|
+
export declare class SetupPoseBoundsProvider implements SpineBoundsProvider {
|
|
79
|
+
private clipping;
|
|
80
|
+
/**
|
|
81
|
+
* @param clipping If true, clipping attachments are used to compute the bounds. False, by default.
|
|
82
|
+
*/
|
|
83
|
+
constructor(clipping?: boolean);
|
|
84
|
+
calculateBounds(gameObject: Spine): {
|
|
85
|
+
x: number;
|
|
86
|
+
y: number;
|
|
87
|
+
width: number;
|
|
88
|
+
height: number;
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
/** A bounds provider that calculates the bounding box by taking the maximumg bounding box for a combination of skins and specific animation. */
|
|
92
|
+
export declare class SkinsAndAnimationBoundsProvider implements SpineBoundsProvider {
|
|
93
|
+
private animation;
|
|
94
|
+
private skins;
|
|
95
|
+
private timeStep;
|
|
96
|
+
private clipping;
|
|
97
|
+
/**
|
|
98
|
+
* @param animation The animation to use for calculating the bounds. If null, the setup pose is used.
|
|
99
|
+
* @param skins The skins to use for calculating the bounds. If empty, the default skin is used.
|
|
100
|
+
* @param timeStep The time step to use for calculating the bounds. A smaller time step means more precision, but slower calculation.
|
|
101
|
+
* @param clipping If true, clipping attachments are used to compute the bounds. False, by default.
|
|
102
|
+
*/
|
|
103
|
+
constructor(animation: string | null, skins?: string[], timeStep?: number, clipping?: boolean);
|
|
104
|
+
calculateBounds(gameObject: Spine): {
|
|
105
|
+
x: number;
|
|
106
|
+
y: number;
|
|
107
|
+
width: number;
|
|
108
|
+
height: number;
|
|
109
|
+
};
|
|
50
110
|
}
|
|
51
111
|
export interface SpineOptions extends ContainerOptions {
|
|
52
112
|
/** the {@link SkeletonData} used to instantiate the skeleton */
|
|
@@ -55,6 +115,8 @@ export interface SpineOptions extends ContainerOptions {
|
|
|
55
115
|
autoUpdate?: boolean;
|
|
56
116
|
/** See {@link SpineFromOptions.darkTint}. */
|
|
57
117
|
darkTint?: boolean;
|
|
118
|
+
/** See {@link SpineFromOptions.boundsProvider}. */
|
|
119
|
+
boundsProvider?: SpineBoundsProvider;
|
|
58
120
|
}
|
|
59
121
|
/**
|
|
60
122
|
* AnimationStateListener {@link https://en.esotericsoftware.com/spine-api-reference#AnimationStateListener events} exposed for Pixi.
|
|
@@ -125,6 +187,10 @@ export declare class Spine extends ViewContainer {
|
|
|
125
187
|
get autoUpdate(): boolean;
|
|
126
188
|
/** When `true`, the Spine AnimationState and the Skeleton will be automatically updated using the {@link Ticker.shared} instance. */
|
|
127
189
|
set autoUpdate(value: boolean);
|
|
190
|
+
private _boundsProvider?;
|
|
191
|
+
/** The bounds provider to use. If undefined the bounds will be dynamic, calculated when requested and based on the current frame. */
|
|
192
|
+
get boundsProvider(): SpineBoundsProvider | undefined;
|
|
193
|
+
set boundsProvider(value: SpineBoundsProvider | undefined);
|
|
128
194
|
private hasNeverUpdated;
|
|
129
195
|
constructor(options: SpineOptions | SkeletonData);
|
|
130
196
|
/** If {@link Spine.autoUpdate} is `false`, this method allows to update the AnimationState and the Skeleton with the given delta. */
|
|
@@ -243,5 +309,5 @@ export declare class Spine extends ViewContainer {
|
|
|
243
309
|
* @param options - Options to configure the Spine game object. See {@link SpineFromOptions}
|
|
244
310
|
* @returns {Spine} The Spine game object instantiated
|
|
245
311
|
*/
|
|
246
|
-
static from({ skeleton, atlas, scale, darkTint, autoUpdate }: SpineFromOptions): Spine;
|
|
312
|
+
static from({ skeleton, atlas, scale, darkTint, autoUpdate, boundsProvider }: SpineFromOptions): Spine;
|
|
247
313
|
}
|