Merge pull request #222 from thecodingmachine/fix_tileset_key
Fixing image tileset key
This commit is contained in:
commit
24c2de94ef
@ -229,7 +229,7 @@ export class GameScene extends Phaser.Scene {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//TODO strategy to add access token
|
//TODO strategy to add access token
|
||||||
this.load.image(tileset.name, `${url}/${tileset.image}`);
|
this.load.image(`${url}/${tileset.image}`, `${url}/${tileset.image}`);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -246,8 +246,9 @@ export class GameScene extends Phaser.Scene {
|
|||||||
create(): void {
|
create(): void {
|
||||||
//initalise map
|
//initalise map
|
||||||
this.Map = this.add.tilemap(this.MapKey);
|
this.Map = this.add.tilemap(this.MapKey);
|
||||||
|
const mapDirUrl = this.MapUrlFile.substr(0, this.MapUrlFile.lastIndexOf('/'));
|
||||||
this.mapFile.tilesets.forEach((tileset: ITiledTileSet) => {
|
this.mapFile.tilesets.forEach((tileset: ITiledTileSet) => {
|
||||||
this.Terrains.push(this.Map.addTilesetImage(tileset.name, tileset.name, tileset.tilewidth, tileset.tileheight, tileset.margin, tileset.spacing/*, tileset.firstgid*/));
|
this.Terrains.push(this.Map.addTilesetImage(tileset.name, `${mapDirUrl}/${tileset.image}`, tileset.tilewidth, tileset.tileheight, tileset.margin, tileset.spacing/*, tileset.firstgid*/));
|
||||||
});
|
});
|
||||||
|
|
||||||
//permit to set bound collision
|
//permit to set bound collision
|
||||||
|
Loading…
Reference in New Issue
Block a user