@melonjs/spine-plugin 1.3.0 → 1.5.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 +19 -1
- package/README.md +52 -17
- package/dist/@melonjs/spine-plugin.d.ts +374 -101
- package/dist/@melonjs/spine-plugin.js +544 -129
- package/package.json +11 -10
- package/src/AssetManager.js +99 -12
- package/src/SpinePlugin.js +24 -0
- package/src/index.js +263 -45
|
@@ -1,6 +1,57 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @classdesc
|
|
3
|
+
* a Spine 4.x plugin implementation for melonJS
|
|
4
|
+
* @augments plugin.BasePlugin
|
|
5
|
+
*/
|
|
6
|
+
export class SpinePlugin extends plugin.BasePlugin {
|
|
7
|
+
constructor();
|
|
8
|
+
assetManager: AssetManager;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* @classdesc
|
|
12
|
+
* An renderable object to render Spine animated skeleton.
|
|
13
|
+
* @augments Renderable
|
|
14
|
+
*/
|
|
15
|
+
declare class Spine extends Renderable {
|
|
16
|
+
/**
|
|
17
|
+
* @param {number} x - the x coordinates of the Spine object
|
|
18
|
+
* @param {number} y - the y coordinates of the Spine object
|
|
19
|
+
* @param {object} settings - Configuration parameters for the Spine object
|
|
20
|
+
* @param {number} [settings.atlasFile] - the name of the atlasFile to be used to create this spine animation
|
|
21
|
+
* @param {number} [settings.jsonFile] - the name of the atlasFile to be used to create this spine animation
|
|
22
|
+
* @param {number} [settings.mixTime = 0.2] - the default mix duration to use when no mix duration has been defined between two animations.
|
|
23
|
+
* @example
|
|
24
|
+
* import * as Spine from '@melonjs/spine-plugin';
|
|
25
|
+
* import * as me from 'melonjs';
|
|
26
|
+
*
|
|
27
|
+
* // prepare/declare assets for the preloader
|
|
28
|
+
* const DataManifest = [
|
|
29
|
+
* {
|
|
30
|
+
* "name": "alien-ess.json",
|
|
31
|
+
* "type": "spine",
|
|
32
|
+
* "src": "data/spine/alien-ess.json"
|
|
33
|
+
* },
|
|
34
|
+
* {
|
|
35
|
+
* "name": "alien.atlas",
|
|
36
|
+
* "type": "spine",
|
|
37
|
+
* "src": "data/spine/alien.atlas"
|
|
38
|
+
* },
|
|
39
|
+
* ]
|
|
40
|
+
*
|
|
41
|
+
* // create a new Spine Renderable
|
|
42
|
+
* let spineAlien = new Spine(100, 100, {atlasFile: "alien.atlas", jsonFile: "alien-ess.json"});
|
|
43
|
+
*
|
|
44
|
+
* // set default animation
|
|
45
|
+
* spineAlien.setAnimation(0, "death", true);
|
|
46
|
+
*
|
|
47
|
+
* // add it to the game world
|
|
48
|
+
* me.game.world.addChild(spineAlien);
|
|
49
|
+
*/
|
|
50
|
+
constructor(x: number, y: number, settings: {
|
|
51
|
+
atlasFile?: number | undefined;
|
|
52
|
+
jsonFile?: number | undefined;
|
|
53
|
+
mixTime?: number | undefined;
|
|
54
|
+
});
|
|
4
55
|
runtime: {
|
|
5
56
|
__proto__: null;
|
|
6
57
|
AlphaTimeline: typeof AlphaTimeline;
|
|
@@ -197,7 +248,6 @@ declare class Spine extends Renderable$1 {
|
|
|
197
248
|
VertexAttachment: typeof VertexAttachment;
|
|
198
249
|
VertexAttribute: typeof VertexAttribute;
|
|
199
250
|
readonly VertexAttributeType: any;
|
|
200
|
-
WebGLBlendModeConverter: typeof WebGLBlendModeConverter;
|
|
201
251
|
WindowedMean: typeof WindowedMean;
|
|
202
252
|
} | {
|
|
203
253
|
__proto__: null;
|
|
@@ -357,59 +407,339 @@ declare class Spine extends Renderable$1 {
|
|
|
357
407
|
WindowedMean: typeof WindowedMean;
|
|
358
408
|
};
|
|
359
409
|
skeleton: any;
|
|
410
|
+
plugin: plugin.BasePlugin;
|
|
411
|
+
renderer: any;
|
|
360
412
|
animationState: any;
|
|
361
413
|
skeletonRenderer: SkeletonRenderer;
|
|
362
|
-
assetManager: any;
|
|
363
414
|
root: any;
|
|
364
415
|
boneOffset: Vector2;
|
|
365
416
|
boneSize: Vector2;
|
|
366
|
-
|
|
367
|
-
x:
|
|
368
|
-
y:
|
|
417
|
+
isSpineFlipped: {
|
|
418
|
+
x: boolean;
|
|
419
|
+
y: boolean;
|
|
369
420
|
};
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
421
|
+
/**
|
|
422
|
+
* Stores settings and other state for the playback of the current animation (if any).
|
|
423
|
+
* @type {TrackEntry}
|
|
424
|
+
* @see http://en.esotericsoftware.com/spine-api-reference#TrackEntry
|
|
425
|
+
* @see setAnimation
|
|
426
|
+
* @default undefined
|
|
427
|
+
* @example
|
|
428
|
+
* // set a default animation to "run"
|
|
429
|
+
* this.setAnimation(0, "run", true);
|
|
430
|
+
* ...
|
|
431
|
+
* ...
|
|
432
|
+
* // pause the animation
|
|
433
|
+
* this.currentTrack.timeScale = 0;
|
|
434
|
+
* ...
|
|
435
|
+
* ...
|
|
436
|
+
* // resume the animation
|
|
437
|
+
* this.currentTrack.timeScale = 1;
|
|
438
|
+
*/
|
|
439
|
+
currentTrack: TrackEntry;
|
|
440
|
+
mixTime: number;
|
|
441
|
+
jsonFile: number | undefined;
|
|
442
|
+
atlasFile: number | undefined;
|
|
373
443
|
set debugRendering(arg: boolean);
|
|
444
|
+
/**
|
|
445
|
+
* Whether to enabler the debug mode when rendering the spine object
|
|
446
|
+
* @default false
|
|
447
|
+
* @type {boolean}
|
|
448
|
+
*/
|
|
374
449
|
get debugRendering(): boolean;
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
450
|
+
/**
|
|
451
|
+
* set and load the given skeleton atlas and json definition files
|
|
452
|
+
* (use this if you did not specify any json or atlas through the constructor)
|
|
453
|
+
* @param {number} [atlasFile] - the name of the atlasFile to be used to create this spine animation
|
|
454
|
+
* @param {number} [jsonFile] - the name of the atlasFile to be used to create this spine animation
|
|
455
|
+
* @example
|
|
456
|
+
* // create a new Spine Renderable
|
|
457
|
+
* let spineAlien = new Spine(100, 100);
|
|
458
|
+
*
|
|
459
|
+
* // set the skeleton
|
|
460
|
+
* spineAlien.setSkeleton("alien.atlas", "alien-ess.json");
|
|
461
|
+
*
|
|
462
|
+
* // set default animation
|
|
463
|
+
* spineAlien.setAnimation(0, "death", true);
|
|
464
|
+
*
|
|
465
|
+
* // add it to the game world
|
|
466
|
+
* me.game.world.addChild(spineAlien);
|
|
467
|
+
*/
|
|
468
|
+
setSkeleton(atlasFile?: number | undefined, jsonFile?: number | undefined): void;
|
|
469
|
+
/**
|
|
470
|
+
* flip the Spine skeleton on the horizontal axis (around its center)
|
|
471
|
+
* @param {boolean} [flip=true] - `true` to flip this Spine object.
|
|
472
|
+
* @returns {Spine} Reference to this object for method chaining
|
|
473
|
+
*/
|
|
474
|
+
flipX(flip?: boolean | undefined): Spine;
|
|
475
|
+
isDirty: boolean | undefined;
|
|
476
|
+
/**
|
|
477
|
+
* flip the Spine skeleton on the vertical axis (around its center)
|
|
478
|
+
* @param {boolean} [flip=true] - `true` to flip this Spine object.
|
|
479
|
+
* @returns {Spine} Reference to this object for method chaining
|
|
480
|
+
*/
|
|
481
|
+
flipY(flip?: boolean | undefined): Spine;
|
|
482
|
+
/**
|
|
483
|
+
* Rotate this Spine object by the specified angle (in radians).
|
|
484
|
+
* @param {number} angle - The angle to rotate (in radians)
|
|
485
|
+
* @param {Vector2d|ObservableVector2d} [v] - an optional point to rotate around
|
|
486
|
+
* @returns {Spine} Reference to this object for method chaining
|
|
487
|
+
*/
|
|
488
|
+
rotate(angle: number, v?: Vector2d | ObservableVector2d): Spine;
|
|
489
|
+
/**
|
|
490
|
+
* scale the Spine object around his anchor point. Scaling actually applies changes
|
|
491
|
+
* to the currentTransform member wich is used by the renderer to scale the object
|
|
492
|
+
* when rendering. It does not scale the object itself. For example if the renderable
|
|
493
|
+
* is an image, the image.width and image.height properties are unaltered but the currentTransform
|
|
494
|
+
* member will be changed.
|
|
495
|
+
* @param {number} x - a number representing the abscissa of the scaling vector.
|
|
496
|
+
* @param {number} [y=x] - a number representing the ordinate of the scaling vector.
|
|
497
|
+
* @returns {Spine} Reference to this object for method chaining
|
|
498
|
+
*/
|
|
499
|
+
scale(x: number, y?: number | undefined): Spine;
|
|
500
|
+
/**
|
|
501
|
+
* update the bounding box for this spine object.
|
|
502
|
+
* (this will automatically update the bounds of the entire skeleton animation)
|
|
503
|
+
* @param {boolean} [absolute=true] - update the bounds size and position in (world) absolute coordinates
|
|
504
|
+
* @returns {Bounds} this shape bounding box Rectangle object
|
|
505
|
+
*/
|
|
506
|
+
updateBounds(absolute?: boolean | undefined): Bounds;
|
|
507
|
+
/**
|
|
508
|
+
* update function (automatically called by melonJS).
|
|
509
|
+
* @param {number} dt - time since the last update in milliseconds.
|
|
510
|
+
* @returns {boolean} true if the renderable is dirty
|
|
511
|
+
*/
|
|
512
|
+
update(dt: number): boolean;
|
|
379
513
|
/**
|
|
380
514
|
* draw this spine object
|
|
381
|
-
* @name draw
|
|
382
|
-
* @memberof Spine
|
|
383
|
-
* @protected
|
|
384
515
|
* @param {CanvasRenderer|WebGLRenderer} renderer - a renderer instance
|
|
385
516
|
* @param {Camera2d} [viewport] - the viewport to (re)draw
|
|
386
517
|
*/
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
518
|
+
draw(renderer: CanvasRenderer | WebGLRenderer): void;
|
|
519
|
+
/**
|
|
520
|
+
* Sets the current animation for a track, discarding any queued animations.
|
|
521
|
+
* @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.
|
|
522
|
+
* @param {number} [index] - the animation index
|
|
523
|
+
* @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.
|
|
524
|
+
* @returns {TrackEntry} A track entry to allow further customization of animation playback. References to the track entry must not be kept after the dispose event occurs.
|
|
525
|
+
*/
|
|
526
|
+
setAnimationByIndex(track_index?: number | undefined, index?: number | undefined, loop?: boolean | undefined): TrackEntry;
|
|
527
|
+
/**
|
|
528
|
+
* Sets the current animation for a track, discarding any queued animations.
|
|
529
|
+
* @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.
|
|
530
|
+
* @param {string} [name] - the animation name
|
|
531
|
+
* @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.
|
|
532
|
+
* @returns {TrackEntry} A track entry to allow further customization of animation playback. References to the track entry must not be kept after the dispose event occurs.
|
|
533
|
+
* @example
|
|
534
|
+
* // set the current animation
|
|
535
|
+
* spineAlien.setAnimation(0, "death", true);
|
|
536
|
+
*/
|
|
537
|
+
setAnimation(track_index?: number | undefined, name?: string | undefined, loop?: boolean | undefined): TrackEntry;
|
|
538
|
+
/**
|
|
539
|
+
* return true if the given animation name is the current running animation for the current track.
|
|
540
|
+
* @name isCurrentAnimation
|
|
541
|
+
* @param {string} name - animation name
|
|
542
|
+
* @returns {boolean}
|
|
543
|
+
* @example
|
|
544
|
+
* if (!this.isCurrentAnimation("death")) {
|
|
545
|
+
* // do something funny...
|
|
546
|
+
* }
|
|
547
|
+
*/
|
|
548
|
+
isCurrentAnimation(name: string): boolean;
|
|
549
|
+
/**
|
|
550
|
+
* Adds an animation to be played after the current or last queued animation for a track, and sets the track entry's mixDuration.
|
|
551
|
+
* @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.
|
|
552
|
+
* @return {TrackEntry} A track entry to allow further customization of animation playback. References to the track entry must not be kept after the dispose} event occurs.
|
|
553
|
+
*/
|
|
554
|
+
addAnimationByIndex(track_index: any, index: any, loop?: boolean, delay?: number | undefined): TrackEntry;
|
|
391
555
|
addAnimationByName(track_index: any, animationName: any, loop?: boolean, delay?: number): void;
|
|
392
556
|
getSpinePosition(): Vector2d;
|
|
393
557
|
setSpineSize(width: any, height: any): void;
|
|
558
|
+
width: any;
|
|
559
|
+
height: any;
|
|
394
560
|
getSpineSize(): {
|
|
395
|
-
width:
|
|
396
|
-
height:
|
|
561
|
+
width: any;
|
|
562
|
+
height: any;
|
|
397
563
|
};
|
|
398
|
-
|
|
564
|
+
/**
|
|
565
|
+
* Set the default mix duration to use when no mix duration has been defined between two animations.
|
|
566
|
+
* @param {number} mixTime
|
|
567
|
+
*/
|
|
568
|
+
setDefaultMixTime(mixTime: number): void;
|
|
569
|
+
/**
|
|
570
|
+
* Sets a mix duration by animation name.
|
|
571
|
+
*/
|
|
399
572
|
setTransitionMixTime(firstAnimation: any, secondAnimation: any, mixTime: any): void;
|
|
400
|
-
|
|
573
|
+
/**
|
|
574
|
+
* Sets a skin by name.
|
|
575
|
+
* @param {string} skinName
|
|
576
|
+
* @example
|
|
577
|
+
* // create a new Spine Renderable
|
|
578
|
+
* let spineAlien = new Spine(100, 100, {atlasFile: "mix-and-match-pma.atlas", jsonFile: "mix-and-match-pro.json"});
|
|
579
|
+
*
|
|
580
|
+
* // set default animation
|
|
581
|
+
* spineAlien.setAnimation(0, "dance", true);
|
|
582
|
+
*
|
|
583
|
+
* // set default skin
|
|
584
|
+
* spineAlien.setSkinByName("full-skins/girl");
|
|
585
|
+
*
|
|
586
|
+
* // add it to the game world
|
|
587
|
+
* me.game.world.addChild(spineAlien);
|
|
588
|
+
*/
|
|
589
|
+
setSkinByName(skinName: string): void;
|
|
590
|
+
/**
|
|
591
|
+
* Reset this slot to the setup pose.
|
|
592
|
+
*/
|
|
401
593
|
setToSetupPose(): void;
|
|
402
594
|
}
|
|
595
|
+
import { plugin } from 'melonjs';
|
|
596
|
+
/**
|
|
597
|
+
* @classdesc
|
|
598
|
+
* An Asset Manager class to load spine assets
|
|
599
|
+
*/
|
|
403
600
|
declare class AssetManager {
|
|
404
|
-
|
|
405
|
-
|
|
601
|
+
/**
|
|
602
|
+
* @param {CanvasRenderer|WebGLRenderer} renderer - a melonJS renderer instance
|
|
603
|
+
* @param {string} [pathPrefix=""] - a default path prefix for assets location
|
|
604
|
+
*/
|
|
605
|
+
constructor(renderer: CanvasRenderer | WebGLRenderer, pathPrefix?: string | undefined);
|
|
606
|
+
asset_manager: {
|
|
607
|
+
pathPrefix: string;
|
|
608
|
+
assets: {};
|
|
609
|
+
errors: {};
|
|
610
|
+
toLoad: number;
|
|
611
|
+
loaded: number;
|
|
612
|
+
textureLoader: any;
|
|
613
|
+
downloader: Downloader;
|
|
614
|
+
start(path: any): string;
|
|
615
|
+
success(callback: any, path: any, asset: any): void;
|
|
616
|
+
error(callback: any, path: any, message: any): void;
|
|
617
|
+
loadAll(): Promise<any>;
|
|
618
|
+
setRawDataURI(path: any, data: any): void;
|
|
619
|
+
loadBinary(path: any, success?: () => void, error?: () => void): void;
|
|
620
|
+
loadText(path: any, success?: () => void, error?: () => void): void;
|
|
621
|
+
loadJson(path: any, success?: () => void, error?: () => void): void;
|
|
622
|
+
loadTexture(path: any, success?: () => void, error?: () => void): void;
|
|
623
|
+
loadTextureAtlas(path: any, success: (() => void) | undefined, error: (() => void) | undefined, fileAlias: any): void;
|
|
624
|
+
get(path: any): any;
|
|
625
|
+
require(path: any): any;
|
|
626
|
+
remove(path: any): any;
|
|
627
|
+
removeAll(): void;
|
|
628
|
+
isLoadingComplete(): boolean;
|
|
629
|
+
getToLoad(): number;
|
|
630
|
+
getLoaded(): number;
|
|
631
|
+
dispose(): void;
|
|
632
|
+
hasErrors(): boolean;
|
|
633
|
+
getErrors(): {};
|
|
634
|
+
} | {
|
|
635
|
+
pathPrefix: string;
|
|
636
|
+
assets: {};
|
|
637
|
+
errors: {};
|
|
638
|
+
toLoad: number;
|
|
639
|
+
loaded: number;
|
|
640
|
+
textureLoader: any;
|
|
641
|
+
downloader: Downloader;
|
|
642
|
+
start(path: any): string;
|
|
643
|
+
success(callback: any, path: any, asset: any): void;
|
|
644
|
+
error(callback: any, path: any, message: any): void;
|
|
645
|
+
loadAll(): Promise<any>;
|
|
646
|
+
setRawDataURI(path: any, data: any): void;
|
|
647
|
+
loadBinary(path: any, success?: () => void, error?: () => void): void;
|
|
648
|
+
loadText(path: any, success?: () => void, error?: () => void): void;
|
|
649
|
+
loadJson(path: any, success?: () => void, error?: () => void): void;
|
|
650
|
+
loadTexture(path: any, success?: () => void, error?: () => void): void;
|
|
651
|
+
loadTextureAtlas(path: any, success: (() => void) | undefined, error: (() => void) | undefined, fileAlias: any): void;
|
|
652
|
+
get(path: any): any;
|
|
653
|
+
require(path: any): any;
|
|
654
|
+
remove(path: any): any;
|
|
655
|
+
removeAll(): void;
|
|
656
|
+
isLoadingComplete(): boolean;
|
|
657
|
+
getToLoad(): number;
|
|
658
|
+
getLoaded(): number;
|
|
659
|
+
dispose(): void;
|
|
660
|
+
hasErrors(): boolean;
|
|
661
|
+
getErrors(): {};
|
|
662
|
+
};
|
|
406
663
|
pathPrefix: string;
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
664
|
+
/**
|
|
665
|
+
* set a default path prefix for assets location
|
|
666
|
+
* @see loadAsset
|
|
667
|
+
* @param {string} pathPrefix
|
|
668
|
+
*/
|
|
669
|
+
setPrefix(pathPrefix: string): void;
|
|
670
|
+
/**
|
|
671
|
+
* define all spine assets to be loaded
|
|
672
|
+
* @see setPrefix
|
|
673
|
+
* @see loadAll
|
|
674
|
+
* @param {string} atlas
|
|
675
|
+
* @param {string} skel
|
|
676
|
+
* @example
|
|
677
|
+
* // "manually" load spine assets
|
|
678
|
+
* Spine.assetManager.setPrefix("data/spine/");
|
|
679
|
+
* Spine.assetManager.loadAsset("alien.atlas", "alien-ess.json");
|
|
680
|
+
* await Spine.assetManager.loadAll();
|
|
681
|
+
*/
|
|
682
|
+
loadAsset(atlas: string, skel: string): void;
|
|
683
|
+
/**
|
|
684
|
+
* load the given texture atlas
|
|
685
|
+
* @param {string} atlas
|
|
686
|
+
*/
|
|
687
|
+
loadTextureAtlas(atlas: string, onload: any, onerror: any): void;
|
|
688
|
+
/**
|
|
689
|
+
* load the given skeleton .skel file
|
|
690
|
+
* @param {string} skel
|
|
691
|
+
*/
|
|
692
|
+
loadBinary(skel: string, onload: any, onerror: any): void;
|
|
693
|
+
/**
|
|
694
|
+
* load the given skeleton binary file
|
|
695
|
+
* @param {string} skel
|
|
696
|
+
*/
|
|
697
|
+
loadText(skel: string, onload: any, onerror: any): void;
|
|
698
|
+
/**
|
|
699
|
+
* load all defined spine assets
|
|
700
|
+
* @see loadAsset
|
|
701
|
+
*/
|
|
702
|
+
loadAll(): Promise<any>;
|
|
703
|
+
/**
|
|
704
|
+
* get the loaded skeleton data
|
|
705
|
+
* @param {string} path
|
|
706
|
+
*/
|
|
707
|
+
require(path: string): any;
|
|
708
|
+
}
|
|
709
|
+
/******************************************************************************
|
|
710
|
+
* Spine Runtimes License Agreement
|
|
711
|
+
* Last updated July 28, 2023. Replaces all prior versions.
|
|
712
|
+
*
|
|
713
|
+
* Copyright (c) 2013-2023, Esoteric Software LLC
|
|
714
|
+
*
|
|
715
|
+
* Integration of the Spine Runtimes into software or otherwise creating
|
|
716
|
+
* derivative works of the Spine Runtimes is permitted under the terms and
|
|
717
|
+
* conditions of Section 2 of the Spine Editor License Agreement:
|
|
718
|
+
* http://esotericsoftware.com/spine-editor-license
|
|
719
|
+
*
|
|
720
|
+
* Otherwise, it is permitted to integrate the Spine Runtimes into software or
|
|
721
|
+
* otherwise create derivative works of the Spine Runtimes (collectively,
|
|
722
|
+
* "Products"), provided that each user of the Products must obtain their own
|
|
723
|
+
* Spine Editor license and redistribution of the Products in any form must
|
|
724
|
+
* include this license and copyright notice.
|
|
725
|
+
*
|
|
726
|
+
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
|
727
|
+
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
728
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
729
|
+
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
|
730
|
+
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
731
|
+
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
|
732
|
+
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
|
733
|
+
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
734
|
+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE
|
|
735
|
+
* SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
736
|
+
*****************************************************************************/
|
|
737
|
+
declare class Renderable {
|
|
738
|
+
constructor(vertices: any, numVertices: any, numFloats: any);
|
|
739
|
+
vertices: any;
|
|
740
|
+
numVertices: any;
|
|
741
|
+
numFloats: any;
|
|
411
742
|
}
|
|
412
|
-
import { Renderable as Renderable$1 } from 'melonjs';
|
|
413
743
|
/** Changes a bone's local {@link Bone#shearX} and {@link Bone#shearY}. */
|
|
414
744
|
declare class AlphaTimeline extends CurveTimeline1 {
|
|
415
745
|
slotIndex: any;
|
|
@@ -2171,34 +2501,6 @@ declare class PointAttachment extends VertexAttachment {
|
|
|
2171
2501
|
computeWorldRotation(bone: any): number;
|
|
2172
2502
|
copy(): PointAttachment;
|
|
2173
2503
|
}
|
|
2174
|
-
/******************************************************************************
|
|
2175
|
-
* Spine Runtimes License Agreement
|
|
2176
|
-
* Last updated July 28, 2023. Replaces all prior versions.
|
|
2177
|
-
*
|
|
2178
|
-
* Copyright (c) 2013-2023, Esoteric Software LLC
|
|
2179
|
-
*
|
|
2180
|
-
* Integration of the Spine Runtimes into software or otherwise creating
|
|
2181
|
-
* derivative works of the Spine Runtimes is permitted under the terms and
|
|
2182
|
-
* conditions of Section 2 of the Spine Editor License Agreement:
|
|
2183
|
-
* http://esotericsoftware.com/spine-editor-license
|
|
2184
|
-
*
|
|
2185
|
-
* Otherwise, it is permitted to integrate the Spine Runtimes into software or
|
|
2186
|
-
* otherwise create derivative works of the Spine Runtimes (collectively,
|
|
2187
|
-
* "Products"), provided that each user of the Products must obtain their own
|
|
2188
|
-
* Spine Editor license and redistribution of the Products in any form must
|
|
2189
|
-
* include this license and copyright notice.
|
|
2190
|
-
*
|
|
2191
|
-
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
|
2192
|
-
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
2193
|
-
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
2194
|
-
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
|
2195
|
-
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
2196
|
-
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
|
2197
|
-
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
|
2198
|
-
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
2199
|
-
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE
|
|
2200
|
-
* SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
2201
|
-
*****************************************************************************/
|
|
2202
2504
|
declare class PolygonBatcher {
|
|
2203
2505
|
static getAndResetGlobalDrawCalls(): number;
|
|
2204
2506
|
constructor(context: any, twoColorTint?: boolean, maxVertices?: number);
|
|
@@ -2215,7 +2517,7 @@ declare class PolygonBatcher {
|
|
|
2215
2517
|
srcAlphaBlend: any;
|
|
2216
2518
|
dstBlend: any;
|
|
2217
2519
|
begin(shader: any): void;
|
|
2218
|
-
setBlendMode(
|
|
2520
|
+
setBlendMode(blendMode: any, premultipliedAlpha: any): void;
|
|
2219
2521
|
draw(texture: any, vertices: any, indices: any): void;
|
|
2220
2522
|
flush(): void;
|
|
2221
2523
|
end(): void;
|
|
@@ -2225,6 +2527,12 @@ declare class PolygonBatcher {
|
|
|
2225
2527
|
declare namespace PolygonBatcher {
|
|
2226
2528
|
let disableCulling: boolean;
|
|
2227
2529
|
let globalDrawCalls: number;
|
|
2530
|
+
let blendModesGL: {
|
|
2531
|
+
srcRgb: number;
|
|
2532
|
+
srcRgbPma: number;
|
|
2533
|
+
dstRgb: number;
|
|
2534
|
+
srcAlpha: number;
|
|
2535
|
+
}[];
|
|
2228
2536
|
}
|
|
2229
2537
|
declare class Pool {
|
|
2230
2538
|
constructor(instantiator: any);
|
|
@@ -3150,40 +3458,6 @@ declare class SkeletonJson {
|
|
|
3150
3458
|
readVertices(map: any, attachment: any, verticesLength: any): void;
|
|
3151
3459
|
readAnimation(map: any, name: any, skeletonData: any): void;
|
|
3152
3460
|
}
|
|
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
3461
|
declare class Vector2 {
|
|
3188
3462
|
constructor(x?: number, y?: number);
|
|
3189
3463
|
x: number;
|
|
@@ -3396,8 +3670,10 @@ declare class SlotData {
|
|
|
3396
3670
|
declare class SpineCanvas {
|
|
3397
3671
|
/** Constructs a new spine canvas, rendering to the provided HTML canvas. */
|
|
3398
3672
|
constructor(canvas: any, config: any);
|
|
3673
|
+
config: any;
|
|
3399
3674
|
/** Tracks the current time, delta, and other time related statistics. */
|
|
3400
3675
|
time: TimeKeeper;
|
|
3676
|
+
disposed: boolean;
|
|
3401
3677
|
htmlCanvas: any;
|
|
3402
3678
|
context: ManagedWebGLRenderingContext;
|
|
3403
3679
|
renderer: SceneRenderer;
|
|
@@ -3434,6 +3710,8 @@ declare class SpineCanvas {
|
|
|
3434
3710
|
input: Input;
|
|
3435
3711
|
/** Clears the canvas with the given color. The color values are given in the range [0,1]. */
|
|
3436
3712
|
clear(r: any, g: any, b: any, a: any): void;
|
|
3713
|
+
/** Disposes the app, so the update() and render() functions are no longer called. Calls the dispose() callback.*/
|
|
3714
|
+
dispose(): void;
|
|
3437
3715
|
}
|
|
3438
3716
|
declare class StringSet {
|
|
3439
3717
|
entries: {};
|
|
@@ -4019,11 +4297,6 @@ declare class VertexAttribute {
|
|
|
4019
4297
|
type: any;
|
|
4020
4298
|
numElements: any;
|
|
4021
4299
|
}
|
|
4022
|
-
declare class WebGLBlendModeConverter {
|
|
4023
|
-
static getDestGLBlendMode(blendMode: any): 1 | 771;
|
|
4024
|
-
static getSourceColorGLBlendMode(blendMode: any, premultipliedAlpha?: boolean): 1 | 770 | 774;
|
|
4025
|
-
static getSourceAlphaGLBlendMode(blendMode: any): 1 | 769 | 771;
|
|
4026
|
-
}
|
|
4027
4300
|
declare class WindowedMean {
|
|
4028
4301
|
constructor(windowSize?: number);
|
|
4029
4302
|
addedValues: number;
|