Jump to content

Phaser createLayer set tiles anchor


cruzlutor
 Share

Recommended Posts

What are you trying to do? I mean, what is setting the tile anchor to (0.5) a solution for?

The tiles are not individual sprites once they're rendered on the screen, so you can't really set each anchor individually. Are you trying to reposition your player sprite to the center of the tile? Would setting it as player.x = tileX + player.width / 2; not be acceptable?

Link to comment
Share on other sites

On 9/16/2016 at 1:40 PM, drhayes said:

What are you trying to do? I mean, what is setting the tile anchor to (0.5) a solution for?

The tiles are not individual sprites once they're rendered on the screen, so you can't really set each anchor individually. Are you trying to reposition your player sprite to the center of the tile? Would setting it as player.x = tileX + player.width / 2; not be acceptable?

Yes, I think that is the best solution, thanks : )

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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