Jump to content

Get mousepointer in onMouseMove event


Recommended Posts

Hi guys,


I want to draw a sprite on the coordinates of my mouse (kind of building). 

My problem is to get the coordinates of the mousepointer into the function ....

See the code below
Thanks in advance :)

var asdf = function(buildSprite: Phaser.Sprite,   buildMode: boolean, x:number, y:number) {            if (buildMode) {                console.log("move");                buildSprite.x = x;                buildSprite.y = y;            } }var _this = this; var _pointer = this.game.input.mousePointer;this.game.input.mouse.onMouseMove = function () {      asdf(_this.buildSprite, _this.buildMode, _pointer.x, _pointer.y);};
Link to comment
Share on other sites


  • Recently Browsing   0 members

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