Jacowaco Posted July 21, 2015 Share Posted July 21, 2015 In my buttons if i press them and then drag the mouse out of the bounds and then get up the button out, the callback is called anyway. I want the callback to only be called if the cursor or touch remains inside the button. How can i do this? Link to comment Share on other sites More sharing options...
Jacowaco Posted July 23, 2015 Author Share Posted July 23, 2015 Maybe i should explain it better.When i touch a button, move the cursor out of the button keeping the mouse pressed, and stop pressing out of the button, the callback is called anyway.Is there an easy way to change this? Link to comment Share on other sites More sharing options...
Ryuuke Posted July 24, 2015 Share Posted July 24, 2015 Hello, You can just check the pointer position before doing your work in the callback function.you can get the pointer position with game.input.x & game.input.y Link to comment Share on other sites More sharing options...
Recommended Posts