animecyc / TiDraggable

An enhanced fork of the original TiDraggable module by Pedro Enrique, allows for simple creation of "draggable" views.
86 stars 37 forks source link

How to create a snap effect? #38

Open max1020 opened 8 years ago

max1020 commented 8 years ago

Thanks for this great contribution. I make a small card game - the player draws cards and drags them to the bottom of the screen where there are a couple of empty card spots. Picking the card and dragging them works great.

How can I add a snap effect to the empty card spots? Do I have to create (another?) touchmove eventlistener? Any general advice is appreciated.

yozef commented 7 years ago

I'd use com.animecyc.Animator to animate and stop the location on end event of the draggableView to a specific location with easing.