Class TileMapRuntimeManager
Methods
getOrLoadSimpleTileMap
- getOrLoadSimpleTileMap(tileMapAsJsObject: EditableTileMapAsJsObject, objectName: string, tileSize: number, columnCount: number, rowCount: number, callback: (tileMap: EditableTileMap) => void): void
Parameters
tileMapAsJsObject: EditableTileMapAsJsObject
objectName: string
tileSize: number
columnCount: number
rowCount: number
callback: (tileMap: EditableTileMap) => void
- (tileMap: EditableTileMap): void
Returns void
getOrLoadSimpleTileMapTextureCache
- getOrLoadSimpleTileMapTextureCache(getTexture: (textureName: string) => BaseTexture<Resource, IAutoDetectOptions>, atlasImageResourceName: string, tileSize: number, columnCount: number, rowCount: number, callback: (textureCache: null | TileTextureCache) => void): void
Parameters
getTexture: (textureName: string) => BaseTexture<Resource, IAutoDetectOptions>
- (textureName: string): BaseTexture<Resource, IAutoDetectOptions>
Parameters
Returns BaseTexture<Resource, IAutoDetectOptions>
atlasImageResourceName: string
tileSize: number
columnCount: number
rowCount: number
callback: (textureCache: null | TileTextureCache) => void
- (textureCache: null | TileTextureCache): void
Parameters
textureCache: null | TileTextureCache
Returns void
Returns void
getOrLoadTextureCache
- getOrLoadTextureCache(getTexture: (textureName: string) => BaseTexture<Resource, IAutoDetectOptions>, atlasImageResourceName: string, tileMapJsonResourceName: string, tileSetJsonResourceName: string, levelIndex: number, callback: (textureCache: null | TileTextureCache) => void): void
Parameters
getTexture: (textureName: string) => BaseTexture<Resource, IAutoDetectOptions>
- (textureName: string): BaseTexture<Resource, IAutoDetectOptions>
Parameters
Returns BaseTexture<Resource, IAutoDetectOptions>
atlasImageResourceName: string
tileMapJsonResourceName: string
tileSetJsonResourceName: string
levelIndex: number
callback: (textureCache: null | TileTextureCache) => void
- (textureCache: null | TileTextureCache): void
Parameters
textureCache: null | TileTextureCache
Returns void
Returns void
getOrLoadTileMap
- getOrLoadTileMap(tileMapJsonResourceName: string, tileSetJsonResourceName: string, levelIndex: number, callback: (tileMapFileContent: null | EditableTileMap) => void): void
Parameters
tileMapJsonResourceName: string
tileSetJsonResourceName: string
levelIndex: number
callback: (tileMapFileContent: null | EditableTileMap) => void
- (tileMapFileContent: null | EditableTileMap): void
Parameters
tileMapFileContent: null | EditableTileMap
Returns void
Returns void
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}.
To use a tile map with collisions, a user can create 4 objects:
To avoid to have 4 copies of the same tile map in memory, this manager puts the tile map in cache and avoid unnecessary parsing.
{@link TileMapManager}