Jump to content

Enlarge sprite click area?


slash
 Share

Recommended Posts

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

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

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...