Jump to content
This forum will be closing down. Please move to the respective dedicated project forums.

What's up with the drag snap x/y sensitivity?


hackenstein
 Share

Recommended Posts

I noticed that if I drag the atari1 sprite in the snap.php example, the sprite will snap up or left after a much smaller drag distance, than if I drag it down or right. Especially with smaller sprites this is very noticeable and feels odd.

Is there a way to change this?

Neither setting the sprite anchor to (0.5,0.5) nor setting a snapOffset seems to help.

 

EDIT:

Ok, I found a way to fix this. I changed Math.floor to Math.round in InputHander.updateDrag:

if (this.snapOnDrag){        this.sprite.x = Math.round(this.sprite.x / this.snapX) * this.snapX;        this.sprite.y = Math.round(this.sprite.y / this.snapY) * this.snapY;}

This way drag&snap handles much better in my opinion.

Edited by hackenstein
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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