Jump to content
Search Community

Picker / Spinner using ThrowProps

Gary Griswold test
Moderator Tag

Recommended Posts

It is mostly done now, but the part that is new to me is that the scrolling needs to snap to the nearest item when the velocity is below some threshold. There is a panel snap scrolling example on the http://greensock.com/throwprops web page that is very helpful.  It is only differs from this problem in axis and that the bounds of the scrolling viewport are the same as the bounds of the item being scrolled.

Link to comment
Share on other sites

For snapping, see the end property in the docs. It explains how you can use a function to snap to a specified increment. So if each item in your spinner was 100px tall you can make sure it always ends on 100px increments. 

 

It sounds like you want to interrupt your tween when a certain threshold is reached. For that you will need to monitor the velocity of the item that is spinning and then perhaps create a new ThrowProps tween. Check out the track() and getVelocity() methods, they should help with that. 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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