-
Notifications
You must be signed in to change notification settings - Fork 33
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
Click events not scrolling with the view? #11
Comments
Same here. Did you manage to fix this? |
Thanks for the report. This is a weird one. The interaction code should work since pixi-scrollbox uses the normal pixi.js transformation functions. I'll see if I can track down the cause. |
Ok, I fixed this bug. You need to update pixi-scrollbox and pixi-viewport from npm. The bug was caused by pixi-viewport.plugins.clamp(). pixi.js's interaction module does not handle containers that move (ie, if the container's position is changing, then it won't register an interaction--which is a weird omission). The viewport.plugins.clamp was improperly changing the position of the viewport (to the same clamped position) each frame even if nothing needed changing. Let me know if there are any problems with this fix. |
HI, This problem still exists. Why your example works, but I have this problem, can you help me solve it? Thank you! |
Sure. Can you provide details on your problem? The bug referenced above I think it fixed. |
/*The above is the code, /* Sorry my English is not very good */ |
This looks right. Can you show me your event code? |
I don't understand the event code you said, sorry... |
My Chinese is not great, regrettably. Is the problem that the scrollbox doesn't work or that you can't interact with the Sprite inside? |
Yes!! And the interaction range is already outside the content. When I set the position of the scrollbox, like this code: If what I said is still unclear, maybe I can video show you, thank you~~! |
Hmm...a JSFiddle would be even more useful to debug the problem. |
I uploaded a video, the interaction range should only be inside the content, but it can also interact outside the content. video URL => https://youtu.be/udnb8G9V9HI |
I'm still not sure what's causing the problem. Can you create a jsfiddle so i can debug it? |
um...I think creating JSfiddle should not help ... because my code is only that. |
I found a new problem. When set |
Sorry to bother you, can you help me solve the problem about the interaction range? |
Can you create a jsfiddle so I can play with it and find the problem? Thanks! |
I have noticed that when using this scrollbox, the visuals in the container are moving but the click "hitboxes" are not.
Below is a modified example from davidfig where I have reduced the content height to force vertical scrolling:
For me, the click events on the circle area are persisting on the left side of the screen, even when the circle is scrolled out of view.
Thanks
The text was updated successfully, but these errors were encountered: