Jojo Posted July 26, 2014 Share Posted July 26, 2014 I should be easy but not sure why I am not finding the answer, I have set up a sprite as so wheel.input.pixelPerfectOver = true; I can see the info on the screen with, game.debug.spriteInputInfo(wheel, 32, 32); I can see all the object info with console.log(wheel); With in a function I want to find out if the mouse is with in the sprite image, in other words get the info that in on the screen into a variable. I can see it on the screen but how to I get that info into a variable? I have tried to many to count wheel.input.pixelPerfectOverwheel.hitAreato name 2 Thanks for your help. Link to comment Share on other sites More sharing options...
lewster32 Posted July 26, 2014 Share Posted July 26, 2014 You can check out the source code for Debug.spriteInputOver to see how it's getting the info it displays on the screen: this.line('x: ' + sprite.input.pointerX().toFixed(1) + ' y: ' + sprite.input.pointerY().toFixed(1)); this.line('over: ' + sprite.input.pointerOver() + ' duration: ' + sprite.input.overDuration().toFixed(0)); this.line('down: ' + sprite.input.pointerDown() + ' duration: ' + sprite.input.downDuration().toFixed(0)); this.line('just over: ' + sprite.input.justOver() + ' just out: ' + sprite.input.justOut()); Link to comment Share on other sites More sharing options...
Jojo Posted July 27, 2014 Author Share Posted July 27, 2014 Thanks for your help lewster32, feels like a DOH! moment why did I not think of look their.. Link to comment Share on other sites More sharing options...
lewster32 Posted July 27, 2014 Share Posted July 27, 2014 I think a lot of people are still afraid to look at the source, but they really shouldn't be - it's very well written and clear as to its purpose. Link to comment Share on other sites More sharing options...
Jojo Posted July 27, 2014 Author Share Posted July 27, 2014 That is very true, I have done that in the past, one reason for the DOH!, I will put it down to a late night, thanks again. Link to comment Share on other sites More sharing options...
Recommended Posts