Jump to content

Vertical gaps between tilemap columns [Solution: this.cameras.main.roundPixels = true;]


Zionviller
 Share

Recommended Posts

I searched and didn't find anything, but:

I am working from the example at: http://labs.phaser.io/view.html?src=src\game objects\tilemap\collision\csv map arcade physics.js
I thought the problem only appeared in my project, but this also happens in the in the example.

When the camera moves horizontally to follow the player, gaps appear between the columns of tiles.

Capture.thumb.PNG.e8edc0770437598a28998c6239c46ac2.PNG


Is there something that I can do to fix this? Is it something only appearing for me?

Thank you!

 

Link to comment
Share on other sites

  • 1 year later...

Just to add: I suffered with this issue this morning (using Phaser 3.1.6) and `this,cameras.main.roundPixels = true` didn't fix it for me. In the end I used good ol' extrusion on my tiles and that solved it. Reference here: https://github.com/photonstorm/phaser/issues/3352#issuecomment-485242513

@rich mentions some other tools for creating extrusions for your tilemaps if `roundPixels` doesn't work for you.

Link to comment
Share on other sites

  • 1 year later...

For my game the camera PixelRound and CANVAS settings did not fully resolve the tile tearing issue.   I am doing a top down isometric, with camera set to follow the hero. 

 

What DID work is setting the velocity of the hero/camera to be a multiple of the tilesize.  

I have a tilesize of 16, therefore setting the velocity of my player/hero to 32 or 64 resolved the issue in my case. 

 

My guess is there is a rounding error somewhere in the stack, by using a value that is a multiple it is able to better handle it.

 

cheers!

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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