Torben Posted May 15, 2014 Share Posted May 15, 2014 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 belowThanks 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 More sharing options...
Torben Posted May 16, 2014 Author Share Posted May 16, 2014 Push Link to comment Share on other sites More sharing options...
Recommended Posts