2020-01-09 18:16:11 +00:00
|
|
|
/// <reference path="./spine.d.ts" />
|
2020-01-18 21:14:07 +00:00
|
|
|
/// <reference path="./SpineFile.d.ts" />
|
|
|
|
/// <reference path="./SpineGameObject.d.ts" />
|
2020-08-25 23:00:09 +00:00
|
|
|
/// <reference path="./SpineContainer.d.ts" />
|
2020-01-09 18:16:11 +00:00
|
|
|
|
|
|
|
declare namespace Phaser.Loader {
|
|
|
|
interface LoaderPlugin extends Phaser.Events.EventEmitter {
|
2020-01-18 21:14:07 +00:00
|
|
|
spine(key: string | Phaser.Loader.FileTypes.SpineFileConfig | Phaser.Loader.FileTypes.SpineFileConfig[], jsonURL: string, atlasURL: string | string[], preMultipliedAlpha?: boolean, textureXhrSettings?: Phaser.Types.Loader.XHRSettingsObject, atlasXhrSettings?: Phaser.Types.Loader.XHRSettingsObject): LoaderPlugin;
|
2020-01-09 18:16:11 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
declare namespace Phaser.GameObjects {
|
|
|
|
interface GameObjectFactory {
|
2020-08-25 23:00:09 +00:00
|
|
|
spine(x: number, y: number, key?: string, animationName?: string, loop?: boolean): SpineGameObject;
|
|
|
|
spineContainer(x: number, y: number, children?: SpineGameObject | SpineGameObject[]): SpineContainer;
|
2020-01-09 18:16:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
interface GameObjectCreator {
|
2020-01-18 21:14:07 +00:00
|
|
|
spine(config: SpineGameObjectConfig, addToScene?: boolean): SpineGameObject;
|
2020-08-25 23:00:09 +00:00
|
|
|
spineContainer(config: SpineContainerConfig, addToScene?: boolean): SpineContainer;
|
2020-01-09 18:16:11 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
declare class SpinePlugin extends Phaser.Plugins.ScenePlugin {
|
2020-01-18 21:14:07 +00:00
|
|
|
constructor(scene: Phaser.Scene, pluginManager: Phaser.Plugins.PluginManager);
|
|
|
|
|
|
|
|
readonly isWebGL: boolean;
|
|
|
|
|
|
|
|
cache: Phaser.Cache.BaseCache;
|
|
|
|
spineTextures: Phaser.Cache.BaseCache;
|
|
|
|
json: Phaser.Cache.BaseCache;
|
|
|
|
textures: Phaser.Textures.TextureManager;
|
|
|
|
drawDebug: boolean;
|
|
|
|
gl: WebGLRenderingContext;
|
|
|
|
renderer: Phaser.Renderer.Canvas.CanvasRenderer | Phaser.Renderer.WebGL.WebGLRenderer;
|
|
|
|
sceneRenderer: spine.webgl.SceneRenderer;
|
|
|
|
skeletonRenderer: spine.canvas.SkeletonRenderer | spine.webgl.SkeletonRenderer;
|
|
|
|
skeletonDebugRenderer: spine.webgl.SkeletonDebugRenderer;
|
|
|
|
|
|
|
|
plugin: typeof spine;
|
|
|
|
|
|
|
|
getAtlasCanvas(key: string): spine.TextureAtlas;
|
|
|
|
getAtlasWebGL(key: string): spine.TextureAtlas;
|
|
|
|
worldToLocal(x: number, y: number, skeleton: spine.Skeleton, bone?: spine.Bone): spine.Vector2;
|
|
|
|
getVector2(x: number, y: number): spine.Vector2;
|
|
|
|
getVector3(x: number, y: number, z: number): spine.Vector2;
|
|
|
|
setDebugBones(value?: boolean): SpinePlugin;
|
|
|
|
setDebugRegionAttachments(value?: boolean): SpinePlugin;
|
|
|
|
setDebugBoundingBoxes(value?: boolean): SpinePlugin;
|
|
|
|
setDebugMeshHull(value?: boolean): SpinePlugin;
|
|
|
|
setDebugMeshTriangles(value?: boolean): SpinePlugin;
|
|
|
|
setDebugPaths(value?: boolean): SpinePlugin;
|
|
|
|
setDebugSkeletonXY(value?: boolean): SpinePlugin;
|
|
|
|
setDebugClipping(value?: boolean): SpinePlugin;
|
|
|
|
setEffect(effect?: spine.VertexEffect): SpinePlugin;
|
|
|
|
createSkeleton(key: string, skeletonJSON?: object): any | null;
|
|
|
|
createAnimationState(skeleton: spine.Skeleton): any;
|
|
|
|
getBounds(skeleton: spine.Skeleton): any;
|
|
|
|
onResize(): void;
|
|
|
|
add(x: number, y: number, key?: string, animationName?: string, loop?: boolean): SpineGameObject;
|
|
|
|
make(config: SpineGameObjectConfig, addToScene?: boolean): SpineGameObject;
|
2020-01-09 18:16:11 +00:00
|
|
|
}
|