Jump to content

phaser ts definition "class Mouse"


Tarion
 Share

Recommended Posts

mouseDownCallback(): void;mouseMoveCallback(): void;mouseUpCallback(): void;

Should be:

mouseDownCallback: Function;mouseMoveCallback: Function;mouseUpCallback: Function;

And the following are internal methods that should not be in the definition at all:

        onMouseDown(): void;        onMouseUp(): void;        onMouseMove(): void;

Usage after the above change:

game.input.mouse.mouseDownCallback = <Function>((e) => this.mouseClick(e));public mouseClick(event:MouseEvent) {            // Works!}

 

Is there a "best way" to commit such changes? I can creates patches for the github repo. Or just post it here as I did?

 

Edit: Added the cast to "Function" anyone who knows how to define the function better, in a way that no cast is needed is welcome :)

Link to comment
Share on other sites

Yes checkout the phaser dev branch on github and then edit the defs file based on that version and submit a pull request, then I can merge it in. I'm doing the 1.1.4 release this week, so any changes you can get in quick will move to master really fast.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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