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

Use viewport parent's local coordinate system rather than global #463

Open lunarraid opened 11 months ago

lunarraid commented 11 months ago

Addresses https://github.com/davidfig/pixi-viewport/issues/49

Currently this library assumes that the Viewport exists in global coordinate space, i.e, on the root stage or in an unscaled container on the stage, and it breaks when in a transformed container. This attempts to address this by getting the coordinates in the local space of the viewport's parent instead of global coordinates.