@mai3/phaser-sdk
Version:
A UI component library based on the Phaser game engine
44 lines • 1.39 kB
TypeScript
import { BaseScene } from "../game";
import { JoystickConfig } from "../types";
import { Container } from "./Container";
import { GameObjects } from "phaser";
export declare class Joystick extends Container<JoystickConfig> {
protected _config: JoystickConfig;
base?: GameObjects.Image;
thumb?: GameObjects.Image;
private pointer?;
private isBeingDragged;
private forceX;
private forceY;
private _force;
private _angle;
private baseRadius;
private thumbRadius;
protected maskShape?: Phaser.GameObjects.Graphics;
protected thumbMaskShape?: Phaser.GameObjects.Graphics;
constructor(scene: BaseScene, config: JoystickConfig);
reDraw(config: JoystickConfig): void;
private clearComponents;
private createComponents;
private setupComponents;
private createMaskedImage;
private createBase;
private createThumb;
private setupInteractive;
private onPointerDown;
private onPointerMove;
private onPointerUp;
private resetJoystick;
private updateJoystickPosition;
get force(): number;
get joystickRotation(): number;
get up(): boolean;
get down(): boolean;
get left(): boolean;
get right(): boolean;
setVisible(visible: boolean): this;
setScrollFactor(factor: number): this;
updateMaskPos(): void;
destroy(): void;
}
//# sourceMappingURL=Joystick.d.ts.map