Tiled Plugin Doesn't Draw the Map #2716
-
Hi, I discovered Excalibur today and wanted to add a TileMap nothing appears on the screen. main.js: import * as ex from "/libs/excalibur.min.js";
import tiled from "https://cdn.skypack.dev/@excaliburjs/plugin-tiled";
// New game
const game = new ex.Engine({ width: 500, height: 400 });
// Create a new TiledMapResource loadable
const tiledMap = new tiled.TiledMapResource("/assets/map/level1.tmx");
// Create a loader and reference the map
const loader = new ex.Loader([tiledMap]);
// Start the game (starts the loader)
game.start(loader).then(function() {
console.log("Game loaded");
tiledMap.addTiledMapToScene(game.currentScene);
}); /assets/map/level1.tmx: <?xml version="1.0" encoding="UTF-8"?>
<map version="1.10" tiledversion="1.10.1" orientation="orthogonal" renderorder="right-down" width="10" height="5" tilewidth="64" tileheight="64" infinite="0" nextlayerid="2" nextobjectid="1">
<tileset firstgid="1" name="Tile-Sets_64x64" tilewidth="64" tileheight="64" tilecount="30" columns="6">
<image source="../Tile-Sets_64x64.png" width="384" height="320"/>
</tileset>
<layer id="1" name="foreground" width="10" height="5">
<data encoding="csv">
19,14,14,14,14,14,14,14,14,7,
9,0,0,0,0,0,0,0,0,7,
9,0,0,0,0,0,0,0,0,7,
9,0,0,0,0,0,0,0,0,7,
25,2,2,2,2,2,2,2,2,26
</data>
</layer>
</map> |
Beta Was this translation helpful? Give feedback.
Answered by
cemalgnlts
Aug 2, 2023
Replies: 1 comment 2 replies
-
I solved the problem but I can't describe it fully. I had problems using excalibur and tiled plugin without using any packer, there was no error, but there was no map drawing, instead I started using unpkg versions for the browser (no modules required). |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
cemalgnlts
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I solved the problem but I can't describe it fully.
I had problems using excalibur and tiled plugin without using any packer, there was no error, but there was no map drawing, instead I started using unpkg versions for the browser (no modules required).