question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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 issue

Hi, 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 with screenWidth and worldWidth.)
  • 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:closed
  • Created 3 years ago
  • Comments:19 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
davidfigcommented, Apr 3, 2020

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.

0reactions
KagiJPNcommented, Apr 5, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found