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

Can multiple viewports share events? #475

Open JiroMercer opened 7 months ago

JiroMercer commented 7 months ago

Hello!

I'm relatively new to PixiJS and Viewports, but I'm really enjoying working with them!

I've been wondering if there's a way to have two (or even more) separate viewports, each with zoom and dragging functionality, but sharing the same interactions.

Just to provide a bit of context, what I'm trying to achieve is to synchronize the movement of both viewports simultaneously when the user drags one of them. Additionally, I'd like them to zoom in or out to the same part of the viewport when the user performs a zoom action in either of the viewports.

Thanks!!

I forgot to say that viewports doesn't have the same size, so applying the position doesn't work for me :(