mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-04 14:24:53 +08:00
Formatting.
This commit is contained in:
parent
4ca219668e
commit
cf68a9fd07
@ -1547,7 +1547,7 @@ spSkeletonData *spSkeletonBinary_readSkeletonData(spSkeletonBinary *self, const
|
|||||||
_spSkeletonBinary_setError(self, self->attachmentLoader->error1, self->attachmentLoader->error2);
|
_spSkeletonBinary_setError(self, self->attachmentLoader->error1, self->attachmentLoader->error2);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
skeletonData->skins[i] =skin;
|
skeletonData->skins[i] = skin;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Linked meshes. */
|
/* Linked meshes. */
|
||||||
|
|||||||
@ -89,12 +89,12 @@ export class SpineGameObject extends ComputedSizeMixin(DepthMixin(FlipMixin(Scro
|
|||||||
constructor (scene: Phaser.Scene, private plugin: SpinePlugin, x: number, y: number, dataKey: string, atlasKey: string, public boundsProvider: SpineGameObjectBoundsProvider = new SetupPoseBoundsProvider()) {
|
constructor (scene: Phaser.Scene, private plugin: SpinePlugin, x: number, y: number, dataKey: string, atlasKey: string, public boundsProvider: SpineGameObjectBoundsProvider = new SetupPoseBoundsProvider()) {
|
||||||
super(scene, SPINE_GAME_OBJECT_TYPE);
|
super(scene, SPINE_GAME_OBJECT_TYPE);
|
||||||
this.setPosition(x, y);
|
this.setPosition(x, y);
|
||||||
|
|
||||||
this.premultipliedAlpha = this.plugin.isAtlasPremultiplied(atlasKey);
|
this.premultipliedAlpha = this.plugin.isAtlasPremultiplied(atlasKey);
|
||||||
this.skeleton = this.plugin.createSkeleton(dataKey, atlasKey);
|
this.skeleton = this.plugin.createSkeleton(dataKey, atlasKey);
|
||||||
this.animationStateData = new AnimationStateData(this.skeleton.data);
|
this.animationStateData = new AnimationStateData(this.skeleton.data);
|
||||||
this.animationState = new AnimationState(this.animationStateData);
|
this.animationState = new AnimationState(this.animationStateData);
|
||||||
this.updateSize();
|
this.updateSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
public get displayOriginX () {
|
public get displayOriginX () {
|
||||||
@ -178,7 +178,7 @@ export class SpineGameObject extends ComputedSizeMixin(DepthMixin(FlipMixin(Scro
|
|||||||
this.skeleton.updateWorldTransform();
|
this.skeleton.updateWorldTransform();
|
||||||
}
|
}
|
||||||
|
|
||||||
preDestroy () {
|
preDestroy () {
|
||||||
// FIXME tear down any event emitters
|
// FIXME tear down any event emitters
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -115,7 +115,7 @@ export class SpinePlugin extends Phaser.Plugins.ScenePlugin {
|
|||||||
|
|
||||||
let makeSpineGameObject = function (this: Phaser.GameObjects.GameObjectFactory, config: SpineGameObjectConfig, addToScene: boolean) {
|
let makeSpineGameObject = function (this: Phaser.GameObjects.GameObjectFactory, config: SpineGameObjectConfig, addToScene: boolean) {
|
||||||
let x = config.x ? config.x : 0;
|
let x = config.x ? config.x : 0;
|
||||||
let y = config.y ? config.y : 0;
|
let y = config.y ? config.y : 0;
|
||||||
let boundsProvider = config.boundsProvider ? config.boundsProvider : undefined;
|
let boundsProvider = config.boundsProvider ? config.boundsProvider : undefined;
|
||||||
let gameObject = new SpineGameObject(this.scene, self, x, y, config.dataKey, config.atlasKey, boundsProvider);
|
let gameObject = new SpineGameObject(this.scene, self, x, y, config.dataKey, config.atlasKey, boundsProvider);
|
||||||
if (addToScene !== undefined) {
|
if (addToScene !== undefined) {
|
||||||
|
|||||||
@ -11,21 +11,21 @@ import { SpineGameObjectConfig, SpinePlugin } from "./SpinePlugin";
|
|||||||
import { SpineGameObject, SpineGameObjectBoundsProvider } from "./SpineGameObject";
|
import { SpineGameObject, SpineGameObjectBoundsProvider } from "./SpineGameObject";
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
namespace Phaser.Loader {
|
namespace Phaser.Loader {
|
||||||
export interface LoaderPlugin {
|
export interface LoaderPlugin {
|
||||||
spineJson(key: string, url: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): LoaderPlugin;
|
spineJson (key: string, url: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): LoaderPlugin;
|
||||||
spineBinary(key: string, url: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): LoaderPlugin;
|
spineBinary (key: string, url: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): LoaderPlugin;
|
||||||
spineAtlas(key: string, url: string, premultipliedAlpha?: boolean, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): LoaderPlugin;
|
spineAtlas (key: string, url: string, premultipliedAlpha?: boolean, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): LoaderPlugin;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace Phaser.GameObjects {
|
namespace Phaser.GameObjects {
|
||||||
export interface GameObjectFactory {
|
export interface GameObjectFactory {
|
||||||
spine(x: number, y: number, dataKey: string, atlasKey: string, boundsProvider?: SpineGameObjectBoundsProvider): SpineGameObject;
|
spine (x: number, y: number, dataKey: string, atlasKey: string, boundsProvider?: SpineGameObjectBoundsProvider): SpineGameObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface GameObjectCreator {
|
export interface GameObjectCreator {
|
||||||
spine(config: SpineGameObjectConfig, addToScene?: boolean): SpineGameObject;
|
spine (config: SpineGameObjectConfig, addToScene?: boolean): SpineGameObject;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user