UNPKG

@mai3/phaser-sdk

Version:

A UI component library based on the Phaser game engine

35 lines 1.43 kB
import { BaseScene } from "../game"; import { SpriteConfig, SpriteAnimConfig } from '../types'; import { BaseButton } from "./BaseButton"; export declare class Sprite extends BaseButton<SpriteConfig> { protected _config: SpriteConfig; directionX: 'left' | 'right' | 'none'; directionY: 'up' | 'down' | 'none'; instance?: Phaser.Physics.Arcade.Sprite; group?: Phaser.Physics.Arcade.Group; private _useCount; private _updateListener?; constructor(scene: BaseScene, config: SpriteConfig); reDraw(config: SpriteConfig): void; resetBody(): void; reDrawGroup(): void; createAnimsSprite(animKey: string, config: SpriteAnimConfig): void; play(key: string | Phaser.Animations.Animation | Phaser.Types.Animations.PlayAnimationConfig, ignoreIfPlaying?: boolean): void; getGroupChild(x?: number, y?: number): any; updatePosition(): void; moveLeft(velocity?: number): void; moveRight(velocity?: number): void; moveUpward(velocity?: number): void; moveDownward(velocity?: number): void; stopHorizontal(): void; stopVertical(): void; setImmovable(immovable?: boolean): void; setBounce(): void; setGravity(): void; stop(): void; setFlipX(flip: boolean): void; getData(key: string | string[]): any; setData<T extends any>(key: (string | T), data?: any): this; destroy(fromScene?: boolean): void; } //# sourceMappingURL=Sprite.d.ts.map