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

TypeScript: Possibly wrong typing of IsoSprite.isoBounds #48

Open
CubixSystem opened this issue Dec 10, 2016 · 0 comments
Open

TypeScript: Possibly wrong typing of IsoSprite.isoBounds #48

CubixSystem opened this issue Dec 10, 2016 · 0 comments

Comments

@CubixSystem
Copy link

I met this error error TS2339: Property 'containsXY' does not exist on type 'Point3'. with my code

isoGroup: Phaser.Group;
...
this.isoGroup.forEach((tile: Phaser.Plugin.Isometric.IsoSprite) => {
    let inBounds: boolean = tile.isoBounds.containsXY(
    this.cursorPos.x,
    this.cursorPos.y
);

I found this lines of code in in phaser.plugin.isometric package
phaser.plugin.isometric.d.ts:

class IsoSprite extends Phaser.Sprite {
    ...
    isoBounds: Phaser.Plugin.Isometric.Point3;
    ...
}

But in phaser-plugin-isometric.js:

Phaser.Plugin.Isometric.IsoSprite.prototype.resetIsoBounds = function () {
    if (typeof this._isoBounds === "undefined") {
        this._isoBounds = new Phaser.Plugin.Isometric.Cube();
    }
    ...
};

In runtime console.log of any Phaser.Plugin.Isometric.IsoSprite instance shown that it has in __proto__ key isoBounds with instance of Phaser.Plugin.Isometric.Cube as a value

@CubixSystem CubixSystem changed the title Typescript: Possibly wrong typing of IsoSprite.isoBounds TypeScript: Possibly wrong typing of IsoSprite.isoBounds Dec 10, 2016
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