davidfig / pixi-viewport

A highly configurable viewport/2D camera designed to work with pixi.js
https://davidfig.github.io/pixi-viewport/
MIT License
1.04k stars 174 forks source link

Dragging in viewport #461

Closed rienheuver closed 12 months ago

rienheuver commented 1 year ago

I'm trying to create something like this example but with viewport: https://pixijs.com/examples/events/dragging

So I want to drag the viewport around when I'm not clicking an object and when I do click on an object, start draggin that.

I'm running into issues with objects jumping around the scene by exactly the distance I dragged the viewport. Do you have an example showcasing this perhaps? I was trying to recreate my problem in a codepen, but I can't get pixi-viewport working in codepen correctly yet...

blnvdanil commented 12 months ago

I would suggest you to setup a demo with your implementation, because it is difficult to say what is the problem in your case just by your description. It seems most likely to be a mathematical mistake in some formulas of your implementation.

rienheuver commented 12 months ago

Had some help from the pixi discord and it has been resolved by now. Forgot to close this issue though. Thanks either way!