Jump to content
This forum will be closing down. Please move to the respective dedicated project forums.

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

 Share

  • Recently Browsing   0 members

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