Jump to content

Tileset bug?


yazer
 Share

Recommended Posts

i'm using Phaser 2.0.3 and Tiled 0.9.1
 
My map in Tiled:

7zQc9TT2dkO9GuWJmLT0Rw.png

My map: 
1QekRLw3fUarp5pzAYUtQw.png
Debug mode:
 R9wg5zHkLUKgTDwUHIOVsg.png
 
Tiles: 
bjItQsE6jybu9FEsrEg.png
 
Level: 

"data":[0, 1, 0, 2, 0, 3, 0, 4, 0, 0, 0, 0, 0, ...

 
 
So as we see, 2nd image is used instead of 1st etc.
 
Open source, find playce when we draw images, change (line 51214)
 

                tile = this._column[x];                set = this.map.tilesets[this.map.tiles[tile.index][2]];

To

                tile = this._column[x];                tile.index -= 1;                 set = this.map.tilesets[this.map.tiles[tile.index][2]];

Result:

GKjnp0MiAkCL9ScUEHPBQ.png

 

So, is it framework bug or my local problem?

Link to comment
Share on other sites

This sounds similar to:

 

http://www.html5gamedevs.com/topic/5706-help-with-tilemaps-and-tilesets/

 

The solution is apparently to call addTilesetImage:

var map = this.game.add.tilemap('tilemapInfo');map.addTilesetImage('Tileset name in Tiled', 'Tileset key in Phaser');

If that's the case, then it does seem weird to me that the framework doesn't throw an error or something if this is excluded, though. I'm sure there's a reason.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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