spritespin
spritespin copied to clipboard
Rotate on scrollwheel, but don't hijack scrollwheel
Basically, I want it to rorate while I'm scrolling down the page, the spritespin instance being fixed position on the page. How can this be acheived.
to change the scroll axis you have to use the orientation
option. For example
orientation: "vertical"
sorry, didn't pay close attention to the question. You want to use the scroll wheel.
In that case, use the 'wheel'
plugin, see example here
https://spritespin.ginie.eu/samples/#/input-wheel
TRhat's... not what I asked at all.
I want to scroll down the page, with the cursor over the object, have the object rotate, but the page still scroll down.
you probably need to implement a custom input module that listens to the scroll event and updates the frame number based on the scroll position. That will for sure work with mousewheel, touch scroll and more importantly the rotation will always be consistent with the scroll position.
Take a look at how the wheel plugin is implemented to get the idea https://github.com/giniedp/spritespin/blob/master/src/plugins/input-wheel.ts
Here is an example on stackblitz
https://stackblitz.com/edit/spritespin-example-scroll?file=index.html