Skip to content
This repository has been archived by the owner on May 8, 2018. It is now read-only.

The scale problems in isobounds tile #56

Open
mcamachon69 opened this issue Oct 5, 2017 · 0 comments
Open

The scale problems in isobounds tile #56

mcamachon69 opened this issue Oct 5, 2017 · 0 comments

Comments

@mcamachon69
Copy link

When you put scale on sprite tile. the unproject coords no working good, you need put code like this
`haser.Plugin.Isometric.IsoSprite.prototype.resetIsoBounds = function () {
if (typeof this._isoBounds === "undefined") {
this._isoBounds = new Phaser.Plugin.Isometric.Cube();
}

this._isoBounds.widthX = Math.round(Math.abs(this.width) * 0.5);
this._isoBounds.widthY = Math.round(Math.abs(this.width) * 0.5);
this._isoBounds.height = Math.round(Math.abs(this.height) - (Math.abs(this.width) * 0.5));

this._isoBounds.x = this.isoX + (this._isoBounds.widthX * -this.anchor.x) + this._isoBounds.widthX * 0.5;
this._isoBounds.y = this.isoY + (this._isoBounds.widthY * this.anchor.x) - this._isoBounds.widthY * 0.5;
this._isoBounds.z = this.isoZ - (Math.abs(this.height) * (1 - this.anchor.y)) + (Math.abs(this.width * 0.5));

return this._isoBounds;`
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant