You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What currently happens is that tile.getCenterX() and tile.getCenterY will return correct values when the layer has scale 1, but wrong values for other scales.
Thank you for submitting this issue. We have fixed this and the fix has been pushed to the master branch. It will be part of the next release. If you get time to build and test it for yourself we would appreciate that.
The following two lines:
Currently look like this:
return this.getLeft(camera) + this.width / 2;
return this.getTop(camera) + this.height / 2;
But they should probably look something like this:
return (this.getLeft(camera) + this.getRight(camera)) / 2;
return (this.getTop(camera) + this.getBottom(camera)) / 2;
Or perhaps like this:
return (tilemapLayer) ? tilemapLayer.tileToWorldX(this.x + 0.5, camera) : (this.x + 0.5) * this.baseWidth
(taking inspiration from Tile.getLeft: https://github.com/photonstorm/phaser/blob/master/src/tilemaps/Tile.js#L368)
What currently happens is that
tile.getCenterX()
andtile.getCenterY
will return correct values when the layer has scale 1, but wrong values for other scales.Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: