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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

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