44 * @augments plugin.BasePlugin
55 */
66export class SpinePlugin extends plugin . BasePlugin {
7+ constructor ( ) ;
8+ assetManager : AssetManager ;
79}
8- export let assetManager : AssetManager ;
910/**
1011 * @classdesc
1112 * An renderable object to render Spine animated skeleton.
@@ -247,7 +248,6 @@ declare class Spine extends Renderable {
247248 VertexAttachment : typeof VertexAttachment ;
248249 VertexAttribute : typeof VertexAttribute ;
249250 readonly VertexAttributeType : any ;
250- WebGLBlendModeConverter : typeof WebGLBlendModeConverter ;
251251 WindowedMean : typeof WindowedMean ;
252252 } | {
253253 __proto__ : null ;
@@ -407,6 +407,8 @@ declare class Spine extends Renderable {
407407 WindowedMean : typeof WindowedMean ;
408408 } ;
409409 skeleton : any ;
410+ plugin : plugin . BasePlugin ;
411+ renderer : any ;
410412 animationState : any ;
411413 skeletonRenderer : SkeletonRenderer ;
412414 root : any ;
@@ -435,7 +437,6 @@ declare class Spine extends Renderable {
435437 * this.currentTrack.timeScale = 1;
436438 */
437439 currentTrack : TrackEntry ;
438- assetManager : AssetManager ;
439440 mixTime : number ;
440441 jsonFile : number | undefined ;
441442 atlasFile : number | undefined ;
@@ -598,11 +599,68 @@ import { plugin } from 'melonjs';
598599 */
599600declare class AssetManager {
600601 /**
602+ * @param {CanvasRenderer|WebGLRenderer } renderer - a melonJS renderer instance
601603 * @param {string } [pathPrefix=""] - a default path prefix for assets location
602604 */
603- constructor ( pathPrefix ?: string | undefined ) ;
604- asset_manager : any ;
605- pathPrefix : any ;
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+ } ;
663+ pathPrefix : string ;
606664 /**
607665 * set a default path prefix for assets location
608666 * @see loadAsset
@@ -626,22 +684,22 @@ declare class AssetManager {
626684 * load the given texture atlas
627685 * @param {string } atlas
628686 */
629- loadTextureAtlas ( atlas : string , onload : any , onerror : any ) : any ;
687+ loadTextureAtlas ( atlas : string , onload : any , onerror : any ) : void ;
630688 /**
631689 * load the given skeleton .skel file
632690 * @param {string } skel
633691 */
634- loadBinary ( skel : string , onload : any , onerror : any ) : any ;
692+ loadBinary ( skel : string , onload : any , onerror : any ) : void ;
635693 /**
636694 * load the given skeleton binary file
637695 * @param {string } skel
638696 */
639- loadText ( skel : string , onload : any , onerror : any ) : any ;
697+ loadText ( skel : string , onload : any , onerror : any ) : void ;
640698 /**
641699 * load all defined spine assets
642700 * @see loadAsset
643701 */
644- loadAll ( ) : any ;
702+ loadAll ( ) : Promise < any > ;
645703 /**
646704 * get the loaded skeleton data
647705 * @param {string } path
@@ -2443,34 +2501,6 @@ declare class PointAttachment extends VertexAttachment {
24432501 computeWorldRotation ( bone : any ) : number ;
24442502 copy ( ) : PointAttachment ;
24452503}
2446- /******************************************************************************
2447- * Spine Runtimes License Agreement
2448- * Last updated July 28, 2023. Replaces all prior versions.
2449- *
2450- * Copyright (c) 2013-2023, Esoteric Software LLC
2451- *
2452- * Integration of the Spine Runtimes into software or otherwise creating
2453- * derivative works of the Spine Runtimes is permitted under the terms and
2454- * conditions of Section 2 of the Spine Editor License Agreement:
2455- * http://esotericsoftware.com/spine-editor-license
2456- *
2457- * Otherwise, it is permitted to integrate the Spine Runtimes into software or
2458- * otherwise create derivative works of the Spine Runtimes (collectively,
2459- * "Products"), provided that each user of the Products must obtain their own
2460- * Spine Editor license and redistribution of the Products in any form must
2461- * include this license and copyright notice.
2462- *
2463- * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
2464- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
2465- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
2466- * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
2467- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
2468- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
2469- * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
2470- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2471- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE
2472- * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2473- *****************************************************************************/
24742504declare class PolygonBatcher {
24752505 static getAndResetGlobalDrawCalls ( ) : number ;
24762506 constructor ( context : any , twoColorTint ?: boolean , maxVertices ?: number ) ;
@@ -2485,10 +2515,9 @@ declare class PolygonBatcher {
24852515 mesh : Mesh ;
24862516 srcColorBlend : any ;
24872517 srcAlphaBlend : any ;
2488- dstColorBlend : any ;
2489- dstAlphaBlend : any ;
2518+ dstBlend : any ;
24902519 begin ( shader : any ) : void ;
2491- setBlendMode ( srcColorBlend : any , srcAlphaBlend : any , dstColorBlend : any , dstAlphaBlend : any ) : void ;
2520+ setBlendMode ( blendMode : any , premultipliedAlpha : any ) : void ;
24922521 draw ( texture : any , vertices : any , indices : any ) : void ;
24932522 flush ( ) : void ;
24942523 end ( ) : void ;
@@ -2498,6 +2527,12 @@ declare class PolygonBatcher {
24982527declare namespace PolygonBatcher {
24992528 let disableCulling : boolean ;
25002529 let globalDrawCalls : number ;
2530+ let blendModesGL : {
2531+ srcRgb : number ;
2532+ srcRgbPma : number ;
2533+ dstRgb : number ;
2534+ srcAlpha : number ;
2535+ } [ ] ;
25012536}
25022537declare class Pool {
25032538 constructor ( instantiator : any ) ;
@@ -2855,10 +2890,9 @@ declare class ShapeRenderer {
28552890 mesh : Mesh ;
28562891 srcColorBlend : any ;
28572892 srcAlphaBlend : any ;
2858- dstColorBlend : any ;
2859- dstAlphaBlend : any ;
2893+ dstBlend : any ;
28602894 begin ( shader : any ) : void ;
2861- setBlendMode ( srcColorBlend : any , srcAlphaBlend : any , dstColorBlend : any , dstAlphaBlend : any ) : void ;
2895+ setBlendMode ( srcColorBlend : any , srcAlphaBlend : any , dstBlend : any ) : void ;
28622896 setColor ( color : any ) : void ;
28632897 setColorWith ( r : any , g : any , b : any , a : any ) : void ;
28642898 point ( x : any , y : any , color : any ) : void ;
@@ -3636,8 +3670,10 @@ declare class SlotData {
36363670declare class SpineCanvas {
36373671 /** Constructs a new spine canvas, rendering to the provided HTML canvas. */
36383672 constructor ( canvas : any , config : any ) ;
3673+ config : any ;
36393674 /** Tracks the current time, delta, and other time related statistics. */
36403675 time : TimeKeeper ;
3676+ disposed : boolean ;
36413677 htmlCanvas : any ;
36423678 context : ManagedWebGLRenderingContext ;
36433679 renderer : SceneRenderer ;
@@ -3674,6 +3710,8 @@ declare class SpineCanvas {
36743710 input : Input ;
36753711 /** Clears the canvas with the given color. The color values are given in the range [0,1]. */
36763712 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 ;
36773715}
36783716declare class StringSet {
36793717 entries : { } ;
@@ -4259,13 +4297,6 @@ declare class VertexAttribute {
42594297 type : any ;
42604298 numElements : any ;
42614299}
4262- declare class WebGLBlendModeConverter {
4263- static getDestGLBlendMode ( blendMode : any ) : 1 | 771 ;
4264- static getDestColorGLBlendMode ( blendMode : any ) : 1 | 769 | 771 ;
4265- static getDestAlphaGLBlendMode ( blendMode : any , premultipliedAlpha ?: boolean ) : 1 | 771 ;
4266- static getSourceColorGLBlendMode ( blendMode : any , premultipliedAlpha ?: boolean ) : 1 | 770 | 774 ;
4267- static getSourceAlphaGLBlendMode ( blendMode : any , premultipliedAlpha ?: boolean ) : 1 | 770 ;
4268- }
42694300declare class WindowedMean {
42704301 constructor ( windowSize ?: number ) ;
42714302 addedValues : number ;
0 commit comments