Jump to content

Phaser 3 Tilemap setting Origin


peevopuff
 Share

Recommended Posts

Hey Community!

I'm trying out the new Phaser 3 Framework using Tilemaps. I create my tilemaps through Tiled and export them as .json.

Since my map doesn't occupy the whole screen, I wanted to center it to the worlds center.
I can render every layer to the screen and center them to the world but I can't center their origin properties since they come by default at 0, 0.
The strange part is that their values change in the layer object to the ones I want but the layer image stays the same.
I've tried using Static or Dynamic layers but there's no difference.

Am I missing something? Is anyone else having trouble using: "layer.setOrigin(0.5, 0.5);"?
Here's a snapshot of my code:

Screen Shot 2018-07-09 at 15.30.40.png

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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