MCPcopy Index your code
hub / github.com/4ian/GDevelop / loadTileMap

Method loadTileMap

Extensions/TileMap/JsExtension.js:1761–1821  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1759 );
1760
1761 const loadTileMap = () => {
1762 /** @type {TileMapHelper.TileMapManager} */
1763 const manager = TilemapHelper.TileMapManager.getManager(
1764 this._project
1765 );
1766 manager.getOrLoadTileMap(
1767 this._loadTileMapWithCallback.bind(this),
1768 tilemapJsonFile,
1769 tilesetJsonFile,
1770 levelIndex,
1771 pako,
1772 (tileMap) => {
1773 if (this._wasDestroyed) return;
1774 if (!tileMap) {
1775 this._onLoadingError();
1776 // _loadTileMapWithCallback already log errors
1777 return;
1778 }
1779
1780 this._editableTileMap = tileMap;
1781
1782 /** @type {TileMapHelper.TileTextureCache} */
1783 manager.getOrLoadTextureCache(
1784 this._loadTileMapWithCallback.bind(this),
1785 (textureName) =>
1786 this._pixiResourcesLoader.getPIXITexture(
1787 this._project,
1788 mapping[textureName] || textureName
1789 ),
1790 tilemapAtlasImage,
1791 tilemapJsonFile,
1792 tilesetJsonFile,
1793 levelIndex,
1794 (textureCache) => {
1795 if (this._wasDestroyed) return;
1796 if (!textureCache) {
1797 this._onLoadingError();
1798 // getOrLoadTextureCache already log warns and errors.
1799 return;
1800 }
1801 this._onLoadingSuccess();
1802 if (!this._editableTileMap) return;
1803
1804 this.width = this._editableTileMap.getWidth();
1805 this.height = this._editableTileMap.getHeight();
1806 TilemapHelper.PixiTileMapHelper.updatePixiTileMap(
1807 this.tileMapPixiObject,
1808 this._editableTileMap,
1809 textureCache,
1810 displayMode,
1811 layerIndex,
1812 0,
1813 this._editableTileMap.getDimensionX(),
1814 0,
1815 this._editableTileMap.getDimensionY()
1816 );
1817 }
1818 );

Callers

nothing calls this directly

Calls 12

_onLoadingErrorMethod · 0.95
_onLoadingSuccessMethod · 0.95
getWidthMethod · 0.65
getHeightMethod · 0.65
getManagerMethod · 0.45
getOrLoadTileMapMethod · 0.45
bindMethod · 0.45
getOrLoadTextureCacheMethod · 0.45
getPIXITextureMethod · 0.45
updatePixiTileMapMethod · 0.45
getDimensionXMethod · 0.45
getDimensionYMethod · 0.45

Tested by

no test coverage detected