When dragging, the world protrudes from the area. Also, if you resize the viewport after zooming, the objects on the screen will disappear.
See original GitHub issueHi, I am Japanese and can hardly speak English. I think it is childish, but please understand. I’m sorry.
I am very interested in PixiJS v5 (WebGL) and am studying. However, I realized that my ideal would require so many implementations that I was stuck. And I met this wonderful library.
〇Ideal implementation
- There are square elements that are resized depending on the window size. Fit the Pixi in it.
- Unlike the displayed element, the actual size is about
8000px * 8000px
. (This is assumed to be implemented withscreenWidth
andworldWidth
.) - Implement zoom in and zoom out. However, it does not zoom out larger than the world size. (That is, you cannot zoom out larger than
scale 1
.) - Also, when zooming in and dragging, it will not be out of the world. (It is assumed that this can be implemented with a
clamp
.)
I’m a beginner, so I don’t know how to use viewport correctly.
I implemented it very hard with reference to past issues etc. However, it does not work as expected.
〇Simple deliverable https://jsfiddle.net/takeshi1234/kt5a1qdv/
Thank you.
Issue Analytics
- State:
- Created 3 years ago
- Comments:19 (8 by maintainers)
Top Results From Across the Web
pixi-viewport API Documentation
Similarly, if you set maxWidth/Height = 100 the world will not be able to zoom larger than the screen size (ie, zooming in...
Read more >Maya/MayaLT QuickTip #6: Viewport Problem - YouTube
Viewport problem when you zoom out and objects disappear or when objects flicker with visual artifacts and how to fix it by adjusting...
Read more >Viewport concepts - CSS: Cascading Style Sheets | MDN
The visual viewport is the visual portion of a screen not including on-screen keyboards, areas outside of a pinch-zoom area, or other feature ......
Read more >Adjust your zoom and view options – Figma Help Center
Click the arrow to the right of the Move Tool to access the Scale tool K . This allows you to resize entire...
Read more >Viewport Controls - Unreal Engine Documentation
When zooming the camera, holding the RMB will hold the FOV, preventing it from snapping back to its default settings. The FOV will...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It’s here: https://github.com/davidfig/pixi-viewport/blob/f5a0db698af9c35a9e3789d5d3440641c6e072dd/src/input-manager.js#L45
passive needs to be false. the whole passive thing is confusing. i wish they used a different term for it.
I tried but it didn’t work.
However, there is no problem because the code I commented can make the expected behavior.
This library is really great.
Also, thank you very much for your kind support.
Thank you.