lewster32 / phaser-plugin-isometric

Feature-packed axonometric plugin for Phaser 2 which stays true to the Phaser API.
http://rotates.org/phaser/iso
MIT License
472 stars 165 forks source link

The scale problems in isobounds tile #56

Open mcamachon69 opened 6 years ago

mcamachon69 commented 6 years ago

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;`