@melonjs/spine-plugin 1.2.1 → 1.4.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/CHANGELOG.md +16 -4
- package/README.md +27 -14
- package/dist/@melonjs/spine-plugin.d.ts +240 -70
- package/dist/@melonjs/spine-plugin.js +499 -90
- package/package.json +11 -10
- package/src/AssetManager.js +38 -12
- package/src/SkeletonRenderer.js +132 -41
- package/src/index.js +189 -19
package/CHANGELOG.md
CHANGED
|
@@ -1,19 +1,31 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## 1.
|
|
3
|
+
## 1.4.0 - 2023-09-xx
|
|
4
|
+
|
|
5
|
+
- add support for loading spine assets through the melonJS preloader (see README)
|
|
6
|
+
- add inline documentation for the Spine class, properties and methods
|
|
7
|
+
- console now display both the plugin and spine runtime versions
|
|
8
|
+
|
|
9
|
+
## 1.3.0 - 2023-08-28
|
|
10
|
+
|
|
11
|
+
- add support for Mesh Attachement
|
|
12
|
+
- added more examples under the test folder and separated them into individual files
|
|
13
|
+
- add a fullscreen option to examples (pressing the "F" key toggles fullscreen mode)
|
|
14
|
+
|
|
15
|
+
## 1.2.1 - 2023-08-23
|
|
4
16
|
|
|
5
17
|
- code refactoring and optimization to prepare for future feature additions
|
|
6
18
|
- fix URLs in the package.json file
|
|
7
19
|
|
|
8
|
-
## 1.2.0 -
|
|
20
|
+
## 1.2.0 - 2023-08-22
|
|
9
21
|
|
|
10
22
|
- add support for clipping (coin example is now rendered properly)
|
|
11
23
|
|
|
12
|
-
## 1.1.0 -
|
|
24
|
+
## 1.1.0 - 2023-08-19
|
|
13
25
|
|
|
14
26
|
- add some basic debug rendering
|
|
15
27
|
- optimize code (remove unneeded logic)
|
|
16
28
|
|
|
17
|
-
## 1.0.0 -
|
|
29
|
+
## 1.0.0 - 2023-08-16
|
|
18
30
|
|
|
19
31
|
initial release
|
package/README.md
CHANGED
|
@@ -13,8 +13,8 @@ a [Spine](http://en.esotericsoftware.com/spine-in-depth) 4.1 plugin implementati
|
|
|
13
13
|
|
|
14
14
|
Installation
|
|
15
15
|
-------------------------------------------------------------------------------
|
|
16
|
-
this plugin is already bundled with the required Spine runtime, so there is no need to install it separately.
|
|
17
|
-
>Note: this plugin requires melonJS version 15.
|
|
16
|
+
this plugin is already bundled with the required Spine [4.x runtime](package.json#dependencies), so there is no need to install it separately.
|
|
17
|
+
>Note: this plugin requires melonJS version 15.10 or higher.
|
|
18
18
|
|
|
19
19
|
To install the plugin using npm :
|
|
20
20
|
|
|
@@ -23,19 +23,32 @@ To install the plugin using npm :
|
|
|
23
23
|
Then import and use the plugin in your project. For example:
|
|
24
24
|
```JavaScript
|
|
25
25
|
import * as Spine from '@melonjs/spine-plugin';
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
26
|
+
import * as me from 'melonjs';
|
|
27
|
+
|
|
28
|
+
// prepare/declare assets for the preloader
|
|
29
|
+
const DataManifest = [
|
|
30
|
+
{
|
|
31
|
+
"name": "alien-ess.json",
|
|
32
|
+
"type": "spine",
|
|
33
|
+
"src": "data/spine/alien-ess.json"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"name": "alien.atlas",
|
|
37
|
+
"type": "spine",
|
|
38
|
+
"src": "data/spine/alien.atlas"
|
|
39
|
+
},
|
|
40
|
+
]
|
|
41
|
+
|
|
42
|
+
// create a new Spine Renderable
|
|
43
|
+
let spineAlien = new Spine(100, 100, {atlasFile: "alien.atlas", jsonFile: "alien-ess.json"});
|
|
44
|
+
|
|
45
|
+
// set default animation
|
|
46
|
+
spineAlien.setAnimation(0, "death", true);
|
|
47
|
+
|
|
48
|
+
// add it to the game world
|
|
49
|
+
me.game.world.addChild(spineAlien);
|
|
38
50
|
```
|
|
51
|
+
>Note: use "spine" as a value for the `type` property to indicate which assets and are actual Spine assets and to be loaded using the plugin (requires version 1.4.0 or higher of the Spine plugin)
|
|
39
52
|
|
|
40
53
|
for more details, see a complete usage example in the [test](test) folder
|
|
41
54
|
|
|
@@ -1,6 +1,49 @@
|
|
|
1
1
|
export let assetManager: AssetManager;
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
/**
|
|
3
|
+
* @classdesc
|
|
4
|
+
* An object to display a Spine animated skeleton on screen.
|
|
5
|
+
* @augments Renderable
|
|
6
|
+
*/
|
|
7
|
+
declare class Spine extends Renderable {
|
|
8
|
+
/**
|
|
9
|
+
* @param {number} x - the x coordinates of the Spine object
|
|
10
|
+
* @param {number} y - the y coordinates of the Spine object
|
|
11
|
+
* @param {object} settings - Configuration parameters for the Spine object
|
|
12
|
+
* @param {number} [settings.atlasFile] - the name of the atlasFile to be used to create this spine animation
|
|
13
|
+
* @param {number} [settings.jsonFile] - the name of the atlasFile to be used to create this spine animation
|
|
14
|
+
* @param {number} [settings.mixTime = 0.2] - the default mix duration to use when no mix duration has been defined between two animations.
|
|
15
|
+
* @example
|
|
16
|
+
* import * as Spine from '@melonjs/spine-plugin';
|
|
17
|
+
* import * as me from 'melonjs';
|
|
18
|
+
*
|
|
19
|
+
* // prepare/declare assets for the preloader
|
|
20
|
+
* const DataManifest = [
|
|
21
|
+
* {
|
|
22
|
+
* "name": "alien-ess.json",
|
|
23
|
+
* "type": "spine",
|
|
24
|
+
* "src": "data/spine/alien-ess.json"
|
|
25
|
+
* },
|
|
26
|
+
* {
|
|
27
|
+
* "name": "alien.atlas",
|
|
28
|
+
* "type": "spine",
|
|
29
|
+
* "src": "data/spine/alien.atlas"
|
|
30
|
+
* },
|
|
31
|
+
* ]
|
|
32
|
+
*
|
|
33
|
+
* // create a new Spine Renderable
|
|
34
|
+
* let spineAlien = new Spine(100, 100, {atlasFile: "alien.atlas", jsonFile: "alien-ess.json"});
|
|
35
|
+
*
|
|
36
|
+
* // set default animation
|
|
37
|
+
* spineAlien.setAnimation(0, "death", true);
|
|
38
|
+
*
|
|
39
|
+
* // add it to the game world
|
|
40
|
+
* me.game.world.addChild(spineAlien);
|
|
41
|
+
*/
|
|
42
|
+
constructor(x: number, y: number, settings: {
|
|
43
|
+
atlasFile?: number | undefined;
|
|
44
|
+
jsonFile?: number | undefined;
|
|
45
|
+
mixTime?: number | undefined;
|
|
46
|
+
});
|
|
4
47
|
runtime: {
|
|
5
48
|
__proto__: null;
|
|
6
49
|
AlphaTimeline: typeof AlphaTimeline;
|
|
@@ -363,53 +406,208 @@ declare class Spine extends Renderable$1 {
|
|
|
363
406
|
root: any;
|
|
364
407
|
boneOffset: Vector2;
|
|
365
408
|
boneSize: Vector2;
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
};
|
|
370
|
-
mixTime: any;
|
|
371
|
-
jsonFile: any;
|
|
372
|
-
atlasFile: any;
|
|
409
|
+
mixTime: number;
|
|
410
|
+
jsonFile: number | undefined;
|
|
411
|
+
atlasFile: number | undefined;
|
|
373
412
|
set debugRendering(arg: boolean);
|
|
413
|
+
/**
|
|
414
|
+
* Whether to enabler the debug mode when rendering the spine object
|
|
415
|
+
* @default false
|
|
416
|
+
* @type {boolean}
|
|
417
|
+
*/
|
|
374
418
|
get debugRendering(): boolean;
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
419
|
+
/**
|
|
420
|
+
* set and load the given skeleton atlas and json definition files
|
|
421
|
+
* (use this if you did not specify any json or atlas through the constructor)
|
|
422
|
+
* @param {number} [atlasFile] - the name of the atlasFile to be used to create this spine animation
|
|
423
|
+
* @param {number} [jsonFile] - the name of the atlasFile to be used to create this spine animation
|
|
424
|
+
* @example
|
|
425
|
+
* // create a new Spine Renderable
|
|
426
|
+
* let spineAlien = new Spine(100, 100);
|
|
427
|
+
*
|
|
428
|
+
* // set the skeleton
|
|
429
|
+
* spineAlien.setSkeleton("alien.atlas", "alien-ess.json");
|
|
430
|
+
*
|
|
431
|
+
* // set default animation
|
|
432
|
+
* spineAlien.setAnimation(0, "death", true);
|
|
433
|
+
*
|
|
434
|
+
* // add it to the game world
|
|
435
|
+
* me.game.world.addChild(spineAlien);
|
|
436
|
+
*/
|
|
437
|
+
setSkeleton(atlasFile?: number | undefined, jsonFile?: number | undefined): void;
|
|
438
|
+
isDirty: boolean | undefined;
|
|
439
|
+
/**
|
|
440
|
+
* Rotate this Spine object by the specified angle (in radians).
|
|
441
|
+
* @param {number} angle - The angle to rotate (in radians)
|
|
442
|
+
* @param {Vector2d|ObservableVector2d} [v] - an optional point to rotate around
|
|
443
|
+
* @returns {Spine} Reference to this object for method chaining
|
|
444
|
+
*/
|
|
445
|
+
rotate(angle: number, v?: Vector2d | ObservableVector2d): Spine;
|
|
446
|
+
/**
|
|
447
|
+
* scale the Spine object around his anchor point. Scaling actually applies changes
|
|
448
|
+
* to the currentTransform member wich is used by the renderer to scale the object
|
|
449
|
+
* when rendering. It does not scale the object itself. For example if the renderable
|
|
450
|
+
* is an image, the image.width and image.height properties are unaltered but the currentTransform
|
|
451
|
+
* member will be changed.
|
|
452
|
+
* @param {number} x - a number representing the abscissa of the scaling vector.
|
|
453
|
+
* @param {number} [y=x] - a number representing the ordinate of the scaling vector.
|
|
454
|
+
* @returns {Spine} Reference to this object for method chaining
|
|
455
|
+
*/
|
|
456
|
+
scale(x: number, y?: number | undefined): Spine;
|
|
457
|
+
/**
|
|
458
|
+
* update the bounding box for this spine object.
|
|
459
|
+
* (this will automatically update the bounds of the entire skeleton animation)
|
|
460
|
+
* @param {boolean} [absolute=true] - update the bounds size and position in (world) absolute coordinates
|
|
461
|
+
* @returns {Bounds} this shape bounding box Rectangle object
|
|
462
|
+
*/
|
|
463
|
+
updateBounds(absolute?: boolean | undefined): Bounds;
|
|
464
|
+
/**
|
|
465
|
+
* update function (automatically called by melonJS).
|
|
466
|
+
* @param {number} dt - time since the last update in milliseconds.
|
|
467
|
+
* @returns {boolean} true if the renderable is dirty
|
|
468
|
+
*/
|
|
469
|
+
update(dt: number): boolean;
|
|
379
470
|
/**
|
|
380
471
|
* draw this spine object
|
|
381
|
-
* @name draw
|
|
382
|
-
* @memberof Spine
|
|
383
|
-
* @protected
|
|
384
472
|
* @param {CanvasRenderer|WebGLRenderer} renderer - a renderer instance
|
|
385
473
|
* @param {Camera2d} [viewport] - the viewport to (re)draw
|
|
386
474
|
*/
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
475
|
+
draw(renderer: CanvasRenderer | WebGLRenderer): void;
|
|
476
|
+
/**
|
|
477
|
+
* Sets the current animation for a track, discarding any queued animations.
|
|
478
|
+
* @param {number} [track_index] - If the formerly current track entry was never applied to a skeleton, it is replaced (not mixed from). In either case trackEnd determines when the track is cleared.
|
|
479
|
+
* @param {number} [index] - the animation index
|
|
480
|
+
* @param {boolean} [loop= false] - If true, the animation will repeat. If false it will not, instead its last frame is applied if played beyond its duration.
|
|
481
|
+
* @returns A track entry to allow further customization of animation playback. References to the track entry must not be kept after the dispose event occurs.
|
|
482
|
+
*/
|
|
483
|
+
setAnimationByIndex(track_index?: number | undefined, index?: number | undefined, loop?: boolean | undefined): void;
|
|
484
|
+
/**
|
|
485
|
+
* Sets the current animation for a track, discarding any queued animations.
|
|
486
|
+
* @param {number} [track_index] - If the formerly current track entry was never applied to a skeleton, it is replaced (not mixed from). In either case trackEnd determines when the track is cleared.
|
|
487
|
+
* @param {string} [name] - the animation name
|
|
488
|
+
* @param {boolean} [loop= false] - If true, the animation will repeat. If false it will not, instead its last frame is applied if played beyond its duration.
|
|
489
|
+
* @returns A track entry to allow further customization of animation playback. References to the track entry must not be kept after the dispose event occurs.
|
|
490
|
+
* @example
|
|
491
|
+
* // set the current animation
|
|
492
|
+
* spineAlien.setAnimation(0, "death", true);
|
|
493
|
+
*/
|
|
494
|
+
setAnimation(track_index?: number | undefined, name?: string | undefined, loop?: boolean | undefined): void;
|
|
495
|
+
/**
|
|
496
|
+
* Adds an animation to be played after the current or last queued animation for a track, and sets the track entry's mixDuration.
|
|
497
|
+
* @param {number} [delay=0] - If > 0, sets delay. If <= 0, the delay set is the duration of the previous track entry minus any mix duration plus the specified `delay` (ie the mix ends at (`delay` = 0) or before (`delay` < 0) the previous track entry duration). If the previous entry is looping, its next loop completion is used instead of its duration.
|
|
498
|
+
* @return A track entry to allow further customization of animation playback. References to the track entry must not be kept after the dispose} event occurs.
|
|
499
|
+
*/
|
|
500
|
+
addAnimationByIndex(track_index: any, index: any, loop?: boolean, delay?: number | undefined): void;
|
|
391
501
|
addAnimationByName(track_index: any, animationName: any, loop?: boolean, delay?: number): void;
|
|
392
502
|
getSpinePosition(): Vector2d;
|
|
393
503
|
setSpineSize(width: any, height: any): void;
|
|
504
|
+
width: any;
|
|
505
|
+
height: any;
|
|
394
506
|
getSpineSize(): {
|
|
395
|
-
width:
|
|
396
|
-
height:
|
|
507
|
+
width: any;
|
|
508
|
+
height: any;
|
|
397
509
|
};
|
|
398
|
-
|
|
510
|
+
/**
|
|
511
|
+
* Set the default mix duration to use when no mix duration has been defined between two animations.
|
|
512
|
+
* @param {number} mixTime
|
|
513
|
+
*/
|
|
514
|
+
setDefaultMixTime(mixTime: number): void;
|
|
515
|
+
/**
|
|
516
|
+
* Sets a mix duration by animation name.
|
|
517
|
+
*/
|
|
399
518
|
setTransitionMixTime(firstAnimation: any, secondAnimation: any, mixTime: any): void;
|
|
400
|
-
|
|
519
|
+
/**
|
|
520
|
+
* Sets a skin by name.
|
|
521
|
+
* @param {string} skinName
|
|
522
|
+
* @example
|
|
523
|
+
* // create a new Spine Renderable
|
|
524
|
+
* let spineAlien = new Spine(100, 100, {atlasFile: "mix-and-match-pma.atlas", jsonFile: "mix-and-match-pro.json"});
|
|
525
|
+
*
|
|
526
|
+
* // set default animation
|
|
527
|
+
* spineAlien.setAnimation(0, "dance", true);
|
|
528
|
+
*
|
|
529
|
+
* // set default skin
|
|
530
|
+
* spineAlien.setSkinByName("full-skins/girl");
|
|
531
|
+
*
|
|
532
|
+
* // add it to the game world
|
|
533
|
+
* me.game.world.addChild(spineAlien);
|
|
534
|
+
*/
|
|
535
|
+
setSkinByName(skinName: string): void;
|
|
536
|
+
/**
|
|
537
|
+
* Sets this slot to the setup pose.
|
|
538
|
+
*/
|
|
401
539
|
setToSetupPose(): void;
|
|
402
540
|
}
|
|
541
|
+
/**
|
|
542
|
+
* @classdesc
|
|
543
|
+
* An Asset Manager class to load spine assets
|
|
544
|
+
*/
|
|
403
545
|
declare class AssetManager {
|
|
404
|
-
|
|
546
|
+
/**
|
|
547
|
+
* @param {string} [pathPrefix=""] - a default path prefix for assets location
|
|
548
|
+
*/
|
|
549
|
+
constructor(pathPrefix?: string | undefined);
|
|
405
550
|
asset_manager: any;
|
|
406
|
-
pathPrefix:
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
551
|
+
pathPrefix: any;
|
|
552
|
+
/**
|
|
553
|
+
* set a default path prefix for assets location
|
|
554
|
+
* @see loadAsset
|
|
555
|
+
* @param {string} pathPrefix
|
|
556
|
+
*/
|
|
557
|
+
setPrefix(pathPrefix: string): void;
|
|
558
|
+
/**
|
|
559
|
+
* define all spine assets to be loaded
|
|
560
|
+
* @see setPrefix
|
|
561
|
+
* @see loadAll
|
|
562
|
+
* @param {string} atlas
|
|
563
|
+
* @param {string} skel
|
|
564
|
+
* @example
|
|
565
|
+
* // load spine assets
|
|
566
|
+
* Spine.assetManager.setPrefix("data/spine/");
|
|
567
|
+
* Spine.assetManager.loadAsset("alien.atlas", "alien-ess.json");
|
|
568
|
+
* await Spine.assetManager.loadAll();
|
|
569
|
+
*/
|
|
570
|
+
loadAsset(atlas: string, skel: string): void;
|
|
571
|
+
/**
|
|
572
|
+
* load all defined spine assets
|
|
573
|
+
* @see loadAsset
|
|
574
|
+
*/
|
|
410
575
|
loadAll(): any;
|
|
411
576
|
}
|
|
412
|
-
|
|
577
|
+
/******************************************************************************
|
|
578
|
+
* Spine Runtimes License Agreement
|
|
579
|
+
* Last updated July 28, 2023. Replaces all prior versions.
|
|
580
|
+
*
|
|
581
|
+
* Copyright (c) 2013-2023, Esoteric Software LLC
|
|
582
|
+
*
|
|
583
|
+
* Integration of the Spine Runtimes into software or otherwise creating
|
|
584
|
+
* derivative works of the Spine Runtimes is permitted under the terms and
|
|
585
|
+
* conditions of Section 2 of the Spine Editor License Agreement:
|
|
586
|
+
* http://esotericsoftware.com/spine-editor-license
|
|
587
|
+
*
|
|
588
|
+
* Otherwise, it is permitted to integrate the Spine Runtimes into software or
|
|
589
|
+
* otherwise create derivative works of the Spine Runtimes (collectively,
|
|
590
|
+
* "Products"), provided that each user of the Products must obtain their own
|
|
591
|
+
* Spine Editor license and redistribution of the Products in any form must
|
|
592
|
+
* include this license and copyright notice.
|
|
593
|
+
*
|
|
594
|
+
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
|
595
|
+
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
596
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
597
|
+
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
|
598
|
+
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
599
|
+
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
|
600
|
+
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
|
601
|
+
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
602
|
+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE
|
|
603
|
+
* SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
604
|
+
*****************************************************************************/
|
|
605
|
+
declare class Renderable {
|
|
606
|
+
constructor(vertices: any, numVertices: any, numFloats: any);
|
|
607
|
+
vertices: any;
|
|
608
|
+
numVertices: any;
|
|
609
|
+
numFloats: any;
|
|
610
|
+
}
|
|
413
611
|
/** Changes a bone's local {@link Bone#shearX} and {@link Bone#shearY}. */
|
|
414
612
|
declare class AlphaTimeline extends CurveTimeline1 {
|
|
415
613
|
slotIndex: any;
|
|
@@ -2213,9 +2411,10 @@ declare class PolygonBatcher {
|
|
|
2213
2411
|
mesh: Mesh;
|
|
2214
2412
|
srcColorBlend: any;
|
|
2215
2413
|
srcAlphaBlend: any;
|
|
2216
|
-
|
|
2414
|
+
dstColorBlend: any;
|
|
2415
|
+
dstAlphaBlend: any;
|
|
2217
2416
|
begin(shader: any): void;
|
|
2218
|
-
setBlendMode(srcColorBlend: any, srcAlphaBlend: any,
|
|
2417
|
+
setBlendMode(srcColorBlend: any, srcAlphaBlend: any, dstColorBlend: any, dstAlphaBlend: any): void;
|
|
2219
2418
|
draw(texture: any, vertices: any, indices: any): void;
|
|
2220
2419
|
flush(): void;
|
|
2221
2420
|
end(): void;
|
|
@@ -2582,9 +2781,10 @@ declare class ShapeRenderer {
|
|
|
2582
2781
|
mesh: Mesh;
|
|
2583
2782
|
srcColorBlend: any;
|
|
2584
2783
|
srcAlphaBlend: any;
|
|
2585
|
-
|
|
2784
|
+
dstColorBlend: any;
|
|
2785
|
+
dstAlphaBlend: any;
|
|
2586
2786
|
begin(shader: any): void;
|
|
2587
|
-
setBlendMode(srcColorBlend: any, srcAlphaBlend: any,
|
|
2787
|
+
setBlendMode(srcColorBlend: any, srcAlphaBlend: any, dstColorBlend: any, dstAlphaBlend: any): void;
|
|
2588
2788
|
setColor(color: any): void;
|
|
2589
2789
|
setColorWith(r: any, g: any, b: any, a: any): void;
|
|
2590
2790
|
point(x: any, y: any, color: any): void;
|
|
@@ -3150,40 +3350,6 @@ declare class SkeletonJson {
|
|
|
3150
3350
|
readVertices(map: any, attachment: any, verticesLength: any): void;
|
|
3151
3351
|
readAnimation(map: any, name: any, skeletonData: any): void;
|
|
3152
3352
|
}
|
|
3153
|
-
/******************************************************************************
|
|
3154
|
-
* Spine Runtimes License Agreement
|
|
3155
|
-
* Last updated July 28, 2023. Replaces all prior versions.
|
|
3156
|
-
*
|
|
3157
|
-
* Copyright (c) 2013-2023, Esoteric Software LLC
|
|
3158
|
-
*
|
|
3159
|
-
* Integration of the Spine Runtimes into software or otherwise creating
|
|
3160
|
-
* derivative works of the Spine Runtimes is permitted under the terms and
|
|
3161
|
-
* conditions of Section 2 of the Spine Editor License Agreement:
|
|
3162
|
-
* http://esotericsoftware.com/spine-editor-license
|
|
3163
|
-
*
|
|
3164
|
-
* Otherwise, it is permitted to integrate the Spine Runtimes into software or
|
|
3165
|
-
* otherwise create derivative works of the Spine Runtimes (collectively,
|
|
3166
|
-
* "Products"), provided that each user of the Products must obtain their own
|
|
3167
|
-
* Spine Editor license and redistribution of the Products in any form must
|
|
3168
|
-
* include this license and copyright notice.
|
|
3169
|
-
*
|
|
3170
|
-
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
|
3171
|
-
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
3172
|
-
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
3173
|
-
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
|
3174
|
-
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
3175
|
-
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
|
3176
|
-
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
|
3177
|
-
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
3178
|
-
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE
|
|
3179
|
-
* SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
3180
|
-
*****************************************************************************/
|
|
3181
|
-
declare class Renderable {
|
|
3182
|
-
constructor(vertices: any, numVertices: any, numFloats: any);
|
|
3183
|
-
vertices: any;
|
|
3184
|
-
numVertices: any;
|
|
3185
|
-
numFloats: any;
|
|
3186
|
-
}
|
|
3187
3353
|
declare class Vector2 {
|
|
3188
3354
|
constructor(x?: number, y?: number);
|
|
3189
3355
|
x: number;
|
|
@@ -4021,8 +4187,10 @@ declare class VertexAttribute {
|
|
|
4021
4187
|
}
|
|
4022
4188
|
declare class WebGLBlendModeConverter {
|
|
4023
4189
|
static getDestGLBlendMode(blendMode: any): 1 | 771;
|
|
4190
|
+
static getDestColorGLBlendMode(blendMode: any): 1 | 769 | 771;
|
|
4191
|
+
static getDestAlphaGLBlendMode(blendMode: any, premultipliedAlpha?: boolean): 1 | 771;
|
|
4024
4192
|
static getSourceColorGLBlendMode(blendMode: any, premultipliedAlpha?: boolean): 1 | 770 | 774;
|
|
4025
|
-
static getSourceAlphaGLBlendMode(blendMode: any): 1 |
|
|
4193
|
+
static getSourceAlphaGLBlendMode(blendMode: any, premultipliedAlpha?: boolean): 1 | 770;
|
|
4026
4194
|
}
|
|
4027
4195
|
declare class WindowedMean {
|
|
4028
4196
|
constructor(windowSize?: number);
|
|
@@ -4073,12 +4241,14 @@ declare class SkeletonRenderer {
|
|
|
4073
4241
|
skeletonRenderer: any;
|
|
4074
4242
|
runtime: any;
|
|
4075
4243
|
tintColor: Color$1;
|
|
4076
|
-
|
|
4244
|
+
tempColor: Color$1;
|
|
4077
4245
|
debugRendering: boolean;
|
|
4078
4246
|
clipper: SkeletonClipping;
|
|
4079
4247
|
clippingVertices: any[];
|
|
4080
4248
|
clippingMask: Polygon;
|
|
4081
4249
|
draw(renderer: any, skeleton: any): void;
|
|
4250
|
+
drawTriangle(renderer: any, img: any, x0: any, y0: any, u0: any, v0: any, x1: any, y1: any, u1: any, v1: any, x2: any, y2: any, u2: any, v2: any): void;
|
|
4251
|
+
computeMeshVertices(slot: any, mesh: any, pma: boolean | undefined, vertexSize: any): void;
|
|
4082
4252
|
}
|
|
4083
4253
|
import { Vector2d } from 'melonjs';
|
|
4084
4254
|
/******************************************************************************
|