Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to manually update scroll offset properly? #1943

Open
algosdev opened this issue May 1, 2024 · 0 comments
Open

How to manually update scroll offset properly? #1943

algosdev opened this issue May 1, 2024 · 0 comments
Labels
question Further information is requested

Comments

@algosdev
Copy link

algosdev commented May 1, 2024

Question:

I'm using ScrollControls and useScroll, based on scroll.offset, I'm moving camera inside useFrame. ScrollControls has pages={20}. At some point, when button is clicked, I need to manually update scroll.offset to half way (page=10), and make it possible to continue scroll from there. I've tried setting scroll.offset = 0.5, which worked. But after I start scrolling, scroll.offset goes to its previous value. I've also tried scroll.el.scrollTo method - no luck. scroll.range, scroll.curve methods seems to be not what I want (still playing with them).

Anyone knows the way?

@algosdev algosdev added the question Further information is requested label May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant