@phaser-plus/perspective2d
Version:
Create games with a linearly transformed projection
68 lines (67 loc) • 1.63 kB
TypeScript
export default World;
export type GridColors = {
background: number;
lines: number;
};
/**
* @typedef GridColors
* @property {number} background
* @property {number} lines
*/
declare class World extends Layer {
/**
* @private
* @type {Grid}
*/
private grid;
/** @private */
private gridUpdate;
/**
* @private
* @type {Structs.Matrix2}
*/
private _projection;
sort: DepthSort;
/**
*
* @param {boolean} flag
* @param {GridColors} [colors]
*/
debug(flag?: boolean, colors?: GridColors): World;
/**
*
* @param {Structs.Matrix2} matrix
*/
set projection(arg: Structs.Matrix2);
get projection(): Structs.Matrix2;
/**
* @param {string} key
* @param {new GameObject2D} gameObjectClass
*/
register(key: string, gameObjectClass: new () => GameObject2D): World;
/**
* @template {GameObject2D} T
* @param {string} key
* @param {number} x
* @param {number} y
* @param {Array<string>} tags
* @returns {T}
*/
add<T extends GameObject2D>(key: string, x: number, y: number): T;
/**
* @template {GameObject2D} T
* @param {T} gameObject
*/
remove<T_1 extends GameObject2D>(gameObject: T_1): World;
/**
* @private
* @param {string} _
* @param {new GameObject2D} gameObjectClass
* @param {Scene} scene
*/
private createInstanceFn;
}
import { Layer } from "@phaser-plus/core";
import DepthSort from "./DepthSort";
import { Structs } from "@phaser-plus/core";
import GameObject2D from "./GameObject2D";