glass22 Posted December 23, 2013 Share Posted December 23, 2013 How to Detect if Mouse Click is over a sprite? Link to comment Share on other sites More sharing options...
feiss Posted December 23, 2013 Share Posted December 23, 2013 Not tested, but should workyoursprite.inputEnabled = true;yoursprite.input.useHandCursor = true; //if you want a hand cursoryoursprite.events.onInputOver.add(yourFunction, this);function yourFunction(event, sprite){ // ... your code}You have more events in: http://gametest.mobi/phaser/docs/Events.js.html another untested way:yoursprite.inputEnabled = true;//..inside your update() function...if (yoursprite.input.pointerOver()) { //..your code}you have a lot of stuff in yoursprite.input : http://gametest.mobi/phaser/docs/Phaser.InputHandler.html#toc42 justGoscha 1 Link to comment Share on other sites More sharing options...
aicrop Posted April 11, 2014 Share Posted April 11, 2014 I'd like to ask how to detect if I click in range of x&y equal to 1-100?please answer thank you Link to comment Share on other sites More sharing options...
Recommended Posts