Files
GDevelop/Extensions/TileMap/helper/dts/render/TileMapManager.d.ts
Baptiste Augrain 77320ce12e Add support for LDtk Tilemaps (#4575)
* Tilemaps made with [LDtk](https://ldtk.io/), a modern 2D level editor, can be now used directly. Make sure to save your map made in LDtk as a JSON file, create a new Tilemap object in GDevelop and in the Tilemap field, choose the LDtk file.
* Tilesets used by the LDtk Tilemap are automatically imported in your game - you don't need to import them separately.
* For more information, read about the [Tilemap object on the wiki](https://wiki.gdevelop.io/gdevelop5/objects/tilemap).

Co-authored-by: Davy Hélard <davy.helard@gmail.com>
Co-authored-by: Florian Rival <Florian.Rival@gmail.com>
2022-12-22 18:44:27 +01:00

71 lines
2.6 KiB
TypeScript

import { EditableTileMap } from '../model/TileMapModel';
import { TileTextureCache } from './TileTextureCache';
import PIXI = GlobalPIXIModule.PIXI;
import { TileMap } from '../types';
/**
* A holder to share tile maps across the 2 extension objects.
*
* Every instance with the same files path in properties will
* share the same {@link EditableTileMap} and {@link TileTextureCache}.
*
* @see {@link TileMapRuntimeManager}
*/
export declare class TileMapManager {
private _tileMapCache;
private _textureCacheCaches;
constructor();
/**
* @param instanceHolder Where to set the manager instance.
* @returns The shared manager.
*/
static getManager(instanceHolder: Object): TileMapManager;
/**
* @param data JSON data.
* @returns The data enclosed with its detected kind.
*/
static identify(data: any): TileMap | null;
/**
* @param loadTileMap The method that loads the Tiled JSON file in memory.
* @param tileMapJsonResourceName The resource name of the tile map.
* @param tileSetJsonResourceName The resource name of the tile set.
* @param levelIndex The level of the tile map to load from.
* @param pako The zlib library.
* @param callback A function called when the tile map is parsed.
*/
getOrLoadTileMap(
loadTileMap: (
tileMapJsonResourceName: string,
tileSetJsonResourceName: string,
callback: (tileMap: TileMap | null) => void
) => void,
tileMapJsonResourceName: string,
tileSetJsonResourceName: string,
levelIndex: number,
pako: any,
callback: (tileMap: EditableTileMap | null) => void
): void;
/**
* @param loadTileMap The method that loads the Tiled JSON file in memory.
* @param getTexture The method that loads the atlas image file in memory.
* @param atlasImageResourceName The resource name of the atlas image.
* @param tileMapJsonResourceName The resource name of the tile map.
* @param tileSetJsonResourceName The resource name of the tile set.
* @param levelIndex The level of the tile map to load from.
* @param callback A function called when the tiles textures are split.
*/
getOrLoadTextureCache(
loadTileMap: (
tileMapJsonResourceName: string,
tileSetJsonResourceName: string,
callback: (tileMap: TileMap | null) => void
) => void,
getTexture: (textureName: string) => PIXI.BaseTexture<PIXI.Resource>,
atlasImageResourceName: string,
tileMapJsonResourceName: string,
tileSetJsonResourceName: string,
levelIndex: number,
callback: (textureCache: TileTextureCache | null) => void
): void;
}
//# sourceMappingURL=TileMapManager.d.ts.map