slash Posted March 13, 2014 Share Posted March 13, 2014 Hi all! Is there a way to enlarge the click area around a sprite so that it's easier for the player to tap on it? I'm using sprite.inputEnabled and sprite.events.onInputDown, but for small sprites it requires a lot of precision on player's fingers. Link to comment Share on other sites More sharing options...
slash Posted March 13, 2014 Author Share Posted March 13, 2014 Or is adding a bigger transparent sprite the only way to do it? Link to comment Share on other sites More sharing options...
ctmartinez1992 Posted March 13, 2014 Share Posted March 13, 2014 I'm trying to look on the documentations for some clue and i can't seem to find anything, you always have that solution of course but i would assume there is a simpler way to do it Link to comment Share on other sites More sharing options...
ctmartinez1992 Posted March 13, 2014 Share Posted March 13, 2014 There actually seems to be another way, which is to access the sprite.body.shape variable, this seems to be what handles collisions. You basically need to set it to bigger SAT object. SAT.js is another library that handles 2D collisions: https://github.com/jriecken/sat-js Sorry that i can't help you more right now by giving some code but if you want to the collisions properly, i would start there Link to comment Share on other sites More sharing options...
slash Posted March 13, 2014 Author Share Posted March 13, 2014 I wonder if collisions and clicks share the same body model? I thought the body was meant to be used within the physics "module" Link to comment Share on other sites More sharing options...
Recommended Posts