Jump to content

Phaser tilemap is rendered strange


Morph
 Share

Recommended Posts

Hey there :)

 

I have a little problem with Phaser.io. I try to load a tilemap with it's tileset. The bug didn't exists before, but if I now try to load a tilemap, it everytime shows me something like this:

ZTwOHaS.png

 

I rewrote the code multiple times and I also copied the code from the examples on phaser.io but nothing resolved the problem.

So, this is my current code, which should only load and show the map:

var game = new Phaser.Game(640, 480, Phaser.AUTO, 'phaser', {	preload: preload,	create: create,	update: update,	render: render});var map;var layer;function preload() {	game.load.tilemap('map.demo', 'Test.json');	game.load.image('tileset.demo', 'Test.png')}function create() {	map = game.add.tilemap('map.demo', 32, 32);	map.addTilesetImage('tileset.demo');	layer = map.createLayer(0);	layer.resizeWorld();}function update() {}function render() {}

I attached the tileset I used for this test.

Here is the JSON Code:

{ "height":15, "layers":[        {         "data":[53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 52, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 52, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 52, 21, 22, 22, 22, 22, 22, 22, 22, 23, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 52, 31, 0, 0, 0, 0, 0, 0, 0, 33, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 52, 31, 0, 0, 0, 0, 0, 0, 0, 33, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 52, 31, 0, 0, 0, 0, 0, 0, 0, 33, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 52, 41, 22, 22, 22, 42, 22, 22, 22, 43, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 52, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 52, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 52, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 52, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 52, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 52, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 52, 53, 53, 53, 53, 53, 53, 53, 53, 53],         "height":15,         "name":"Kachelebene 1",         "opacity":1,         "type":"tilelayer",         "visible":true,         "width":20,         "x":0,         "y":0        }], "orientation":"orthogonal", "properties":    {    }, "tileheight":16, "tilesets":[        {         "firstgid":1,         "image":"Test.png",         "imageheight":448,         "imagewidth":160,         "margin":0,         "name":"Demo",         "properties":            {            },         "spacing":0,         "tileheight":16,         "tilewidth":16        }], "tilewidth":16, "version":1, "width":20}

Does anyone know this problem too?

 

- Morph

post-13687-0-78668000-1426782565.png

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...