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

Scrolling sideways using a mousewheel #51

Open
IJsLauw opened this issue Sep 21, 2022 · 3 comments
Open

Scrolling sideways using a mousewheel #51

IJsLauw opened this issue Sep 21, 2022 · 3 comments

Comments

@IJsLauw
Copy link

IJsLauw commented Sep 21, 2022

How can I tell the scrollbar or rather the viewport to scroll on the x axis using the mousewheel?

From the api of viewport I thought this should have worked:

`scrollbox.content.wheel = false

scrollbox.content.drag( {
direction: 'x',
wheel: true
})`

But it didn't, am I doing this all wrong? Can someone show me how to achieve this?

@davidfig
Copy link
Owner

I don't think there's support for that behavior in the code. After turning off the wheel listener in the pixi-scrollbox (or perhaps pixi-viewport?), you'll have to add your own wheel listener to support it. Just look for the wheel listener and then follow the code and you should find how we did the y scrolling.

@IJsLauw
Copy link
Author

IJsLauw commented Sep 21, 2022

Ok, that sounds like that could work (too?), but what is above code supposed to do then?

image

Again looking at the above docs for pixi-viewport which (scrollbox.content is right?). To me it reads as I can use the wheel to drag in the direction supplied, if I disable the wheel plugin (for zooming)

@davidfig
Copy link
Owner

Yes, you can use drag just like it's used in pixi-scrollbox. But i don't think the drag plugin supports the wheel in the 'x' direction. You can check. If not, either create a new plugin for the scrollbox.content (viewport), or handle the wheel even in your client code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants