duckengine
Version:
A 2D Game Engine for the web.
39 lines (38 loc) • 1.15 kB
TypeScript
import { Duck } from '../..';
import Game from '../game';
import Scene from '../scene';
import Map from './map';
import TileLayer from './tilelayer';
/**
* @class TileMap
* @classdesc Creates a DuckEngine TileMap
* @description The TileMap Class. Creates a tilemap of images
* @extends Map
* @since 1.0.0
*/
export default class TileMap extends Map {
/**
* @constructor TileMap
* @description Creates a TileMap instance.
* @param {TileLayer[]} tileLayers An array of TileLayers
* @param {Game} game Game instance
* @param {Scene} scene Scene instance
* @since 1.0.0
*/
constructor(origin: Duck.Types.Math.Vector2Like, tileLayers: TileLayer[], game: Game, scene: Scene);
/**
* @description Draws the tilemap.
*
* DO NOT CALL MANUALLY, CALLED IN GAME LOOP USING SCENE.displayList
*
*/
_draw(): void;
/**
* @memberof Tilemap
* @description Gets visible layers based on filter, then depth sorts the layers
* @param {boolean} [filter=true]
* @returns {TileLayer[]}
* @since 2.0.0
*/
sortTileLayers(filter?: boolean): TileLayer[];
}