gajus / swing

A swipeable cards interface. The swipe-left/swipe-right for yes/no input. As seen in apps like Jelly and Tinder.
Other
2.63k stars 247 forks source link

Add time to card.throwOut()/ card.throwIn() #22

Open Moussawi7 opened 9 years ago

Moussawi7 commented 9 years ago

Thanks for this amazing code, it work excellent on mobile devices. How I can add time when I ThrowOut()/throwIn() a card. I need to to make something similar to this:

   card.throwOut(100, 500,3000);//where 3000 is the time(ms) that card will take to be in the position (100,500), like in css (transition :3s;)

Thank you again.

gajus commented 9 years ago

There is no way to do it due to the nature of the spring physics engine. You could change the tension to adjust the force with which the card is thrown (and thus the time), though that would depend on the throw distance (among other factors).