davidfig / pixi-viewport

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

Multiple canvases with independent viewports? #67

Closed Mutilar closed 6 years ago

Mutilar commented 6 years ago

Hello,

This library has been very useful, but I have run into what might be considered an edge use case: I'm trying to get multiple viewports/cameras working. I've looked into having unique canvases for each viewport, but that doesn't seem to work, as the event handlers are shared between the two canvases (e.g. zooming on one canvas zooms on the other as well).

Is there an easy implementation that comes to mind? I thought I'd shoot this out there in case you've ever run into a similar use case.

Thanks, Brian

davidfig commented 6 years ago

Are these multiple viewports into the same scene or different scenes? If it's the same scene, then can you share some pseudo code on how you set it up? If it's different scenes, then it's easy (see https://davidfig.github.io/pixi-scrollbox/).

davidfig commented 6 years ago

Closing this. Please reopen if you still have this issue. Thanks!