A holder to share tile maps across the 2 extension objects.

Every instance with the same files path in properties will share the same EditableTileMap and 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

TileMapManager

Constructors

Methods

  • Parameters

    • tileMapAsJsObject: EditableTileMapAsJsObject
    • objectName: string
    • tileSize: number
    • columnCount: number
    • rowCount: number
    • callback: ((tileMap) => void)
        • (tileMap): void
        • Parameters

          • tileMap: EditableTileMap

          Returns void

    Returns void

  • Parameters

    • getTexture: ((textureName) => BaseTexture<Resource, IAutoDetectOptions>)

      The method that loads the atlas image file in memory.

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

          • textureName: string

          Returns BaseTexture<Resource, IAutoDetectOptions>

    • atlasImageResourceName: string

      The resource name of the atlas image.

    • tileSize: number
    • columnCount: number
    • rowCount: number
    • callback: ((textureCache) => void)

      A function called when the tiles textures are split.

        • (textureCache): void
        • Parameters

          • textureCache: null | TileTextureCache

          Returns void

    • errorCallback: ((error) => void)
        • (error): void
        • Parameters

          • error: Error

          Returns void

    Returns void

  • Parameters

    • getTexture: ((textureName) => BaseTexture<Resource, IAutoDetectOptions>)

      The method that loads the atlas image file in memory.

        • (textureName): 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) => void)

      A function called when the tiles textures are split.

        • (textureCache): void
        • Parameters

          • textureCache: null | TileTextureCache

          Returns void

    Returns 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) => void)

      A function called when the tile map is parsed.

        • (tileMapFileContent): void
        • Parameters

          • tileMapFileContent: null | EditableTileMap

          Returns void

    Returns void