Jump to content
Search Community

Draggable Rotation Direction for Circle when Bounds Set

faction23 test
Moderator Tag

Go to solution Solved by PointC,

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Hello! First post here for a library i have been happily using for many years. Big thank you for this amazing toolkit, proudly support it. ;)

 

In regards to draggable with a type of "rotation" set, i am having a brain glitch trying to sort how to invert the direction for a set range of degrees on a circle. 

here is a pen: 

how can i make that direction invert so you can drag the other direction from how it is moving now? Can you?

 

Thanks so much. 

See the Pen PppGGz by aiwazz (@aiwazz) on CodePen

Link to comment
Share on other sites

To clarify i have it controlling a dial of decades and outputting current decade to control markers on a map. The steps are nicely setup and working on the snap callback. Team just requested i change direction. Here is the svg the draggable is overlaid on and spins (plus emitting the decade in the other js uses to get markers for map). http://estok.ninja/screens/Map_Markers_Archive_-_Harvard_Law_Bicentennial_1E72342A.png You can see that wheel wants the draggable to go the other direction from what it natively does on this config i have. 

Link to comment
Share on other sites

  • Solution

Hi faction23 :)

 

Unless I'm not understanding the question, I think you should be able to set your max to 0 and your min to -316.8. So you'd have this in your example:

Draggable.create(".dial", {
type: 'rotation',
throwProps: true,
edgeResistance: 0.85,
bounds: {
minRotation: -316.8,
maxRotation: 0,
  },
  }
)

Does that help or have I misunderstood the desired result?

 

Happy tweening.

:)

  • Like 3
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...