Jump to content

Drawing Offset


entiendoNull
 Share

Recommended Posts

Hello there!

I've got a question regarding the "Drawing Offset" that the Tiled mapeditor has.
In short, does Phaser supports it?
The map that I am using has several layers.
The general size of a tile is 32x32px, but some sprites are twice as big. Even though it looks good in "Tiled" I noticed that the positions of my "trees" below had moved when I run the game.
I've been trying to track the Tiled property "tileoffset" down... and thought it might be located in the Phaser.Tileset object within the drawCoords array. But, that does not seem to the trick..?
I've attached a few images below to illustrate what I mean.

Edit:

Just read that Phaser v. 2.7.5 might have this feature implemented. Will be trying in a few hours.
I will get back with the results of that test in case others have similar issues in future.

58ebef2b81ecb_Skarmavbild2017-04-10kl_22_42_35.png.8561753cd3099ae61f15a723d80ed6a3.png
Tiled Mapeditor Tileset settings

58ebf083c3575_Skarmavbild2017-04-10kl_22_49_06.png.3f28629a746b329894764706f07e19e9.png
Within Tiled Mapeditor

58ebf084d23f2_Skarmavbild2017-04-10kl_22_49_29.png.a73ddbf3fed2e3db622af88482a8afd4.png
When the game has rendered

In my Tiled JSON file I've got the following:

{
   "columns":1,
   "firstgid":41,
   "image":"..\/sprites\/tree.gif",
   "imageheight":64,
   "imagewidth":64,
   "margin":0,
   "name":"tree",
   "spacing":0,
   "tilecount":1,
   "tileheight":64,
   "tileoffset":
       {
       "x":-32,
       "y":0
       },
   "tilewidth":64
 }

Any help or clarification is much appriciated.

Best regards!

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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