Comments (17)
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.
from pixi-scrollbox.
Same here. Did you manage to fix this?
from pixi-scrollbox.
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.
from pixi-scrollbox.
HI, This problem still exists. Why your example works, but I have this problem, can you help me solve it? Thank you!
from pixi-scrollbox.
Sure. Can you provide details on your problem? The bug referenced above I think it fixed.
from pixi-scrollbox.
private _createScrollbox(): void{
this._scrollBox = new Scrollbox({
boxWidth: GameDetails.HEIGHT / 1.2,
boxHeight: GameDetails.WIDTH / 1.28 - 200,
scrollbarSize: 25,
scrollbarBackground: 0x000000,
scrollbarForeground: 0xffbe00,
dragScroll:true,
});
this._scrollBox.position.set(90,270);
this.addChild(this._scrollBox);
const gradTexture = this._createGradTexture();
this._mainPanel = new Sprite(gradTexture);
this._mainPanel.name = '_mainPanel';
this._mainPanel.width = GameDetails.HEIGHT / 1.2;
this._mainPanel.height = GameDetails.WIDTH * 5;
this._scrollBox.content.addChild(this._mainPanel);
this._scrollBox.update();
}
/*The above is the code,
The interaction range is very large and strange, the position of the interaction range is very strange after setting the entire scrollbox position. And it only can trigger mouse scroll events, other mouse events cannot be triggered.
What is the problem? thanks you! */
/* Sorry my English is not very good */
from pixi-scrollbox.
This looks right. Can you show me your event code?
from pixi-scrollbox.
I don't understand the event code you said, sorry...
Or can you contact me by mail? I think you should understand Chinese, I βm Taiwanese XD
from pixi-scrollbox.
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?
from pixi-scrollbox.
Yes!! And the interaction range is already outside the content.
When I set the position of the scrollbox, like this code:this._scrollBox.position.set(90,270);
,
the upper part of the content will not be able to interact, but the bottom half of the content is still interactive, and the outside of the scrollbox also can interact.
If what I said is still unclear, maybe I can video show you, thank you~~!
from pixi-scrollbox.
Hmm...a JSFiddle would be even more useful to debug the problem.
from pixi-scrollbox.
I uploaded a video, the interaction range should only be inside the content, but it can also interact outside the content.
And when I set the position of the box, the upper part of the content can't interact, but the interaction range is still extremely large.
The mouse canβt drag the content to move, it can only scroll, hope this will make you understand the problem, thank you!
video URL => https://youtu.be/udnb8G9V9HI
from pixi-scrollbox.
I'm still not sure what's causing the problem. Can you create a jsfiddle so i can debug it?
from pixi-scrollbox.
um...I think creating JSfiddle should not help ... because my code is only that.
Can you tell me how to adjust the interaction range? thanks.
from pixi-scrollbox.
I found a new problem. When set this._scrollBox.disable = true;
, I can grab the content and move it.
Maybe it is Viewport catch the wrong position that causes the interaction range to be wrong...
from pixi-scrollbox.
Sorry to bother you, can you help me solve the problem about the interaction range?
Or is there any other way to set the interaction range of the scrollbox?
from pixi-scrollbox.
Can you create a jsfiddle so I can play with it and find the problem? Thanks!
from pixi-scrollbox.
Related Issues (20)
- Mouse pointer moves faster than the scroll element HOT 4
- Is "auto scroll" possible ? HOT 1
- Scrollbar slow with mouse wheel on Firefox HOT 2
- Scroll wheel is not correctly positioned when app is resized
- Sprites with negative positions not visible in the viewport HOT 2
- direct loading of library in README doesn't work for me
- Cards in Scrollbox not getting click events HOT 6
- Is this project alive? HOT 1
- high cpu usage + glitching of scrolling HOT 1
- Does this lib support zoom action? HOT 2
- when page destroy,the scrollbox's updateLoop will go on HOT 2
- Issue with the pixi inspector: Uncaught DOMException: Failed to execute 'postMessage' on 'Window': scrollbarMove(e)
- Scrolling sideways using a mousewheel HOT 3
- When scrolling with the mouse content jumps on x
- giving bunch of errors
- How do i use in version pixijs6.4.2οΌ
- Click & Hover effects don't work if scrollbar is at the end
- _maskContent interferes with pointer events
- problem with viewport.events HOT 1
- After the parent element is rotated 90 degrees, when the content is dragged, the horizontal and vertical are reversed
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pixi-scrollbox.