Options
All
  • Public
  • Public/Protected
  • All
Menu

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:

  • one for the the rendering
  • one for the solid platforms
  • one for the jumpthrus
  • one for the ladders

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.

see

{@link TileMapManager}

Hierarchy

  • TileMapRuntimeManager

Index

Methods

  • 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>

      The method that loads the atlas image file in memory.

        • (textureName: string): BaseTexture<Resource, IAutoDetectOptions>
        • Parameters

          • textureName: string

          Returns BaseTexture<Resource, IAutoDetectOptions>

    • atlasImageResourceName: string

      The resource name of the atlas image.

    • tileMapJsonResourceName: string

      The resource name of the tile map.

    • tileSetJsonResourceName: string

      The resource name of the tile set.

    • levelIndex: number

      The level of the tile map.

    • callback: (textureCache: null | TileTextureCache) => void

      A function called when the tiles textures are split.

        • (textureCache: null | TileTextureCache): void
        • Parameters

          • textureCache: null | TileTextureCache

          Returns void

    Returns void

  • getOrLoadTileMap(tileMapJsonResourceName: string, tileSetJsonResourceName: string, levelIndex: number, callback: (tileMapFileContent: null | EditableTileMap) => void): void
  • Parameters

    • tileMapJsonResourceName: string

      The resource name of the tile map.

    • tileSetJsonResourceName: string

      The resource name of the tile set.

    • levelIndex: number

      The level of the tile map.

    • callback: (tileMapFileContent: null | EditableTileMap) => void

      A function called when the tile map is parsed.

        • (tileMapFileContent: null | EditableTileMap): void
        • Parameters

          • tileMapFileContent: null | EditableTileMap

          Returns void

    Returns void

Constructors

Generated using TypeDoc