You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I need to have the Y axis point upwards, and the only sensible way I found to do this is just to set negative scale to it.
viewport.scale = new Point(1, -1);
Apparently this needs to be done to viewport and not the app stage. This effectively rotates everything around the X axis, and my coordinate system is what I wanted. What is happening now though is that zooming, panning and all other mouse interactions stop working - I'm not getting any exceptions, there's simply no reaction to any mouse movements.
The text was updated successfully, but these errors were encountered:
With some debugging I managed to figure out what the problem is. Or problems, for that matter.
First, panning doesn't work because the hitArea of the viewport is, at this scale, a rectangle with negative height, and the contains() method of the Rectangle class instantly returns false when checking for hits, and the event is not handled. Rectangles probably would need to readjust themselves to make sure this doesn't happen. Or handle negative values, why not. Or created provided correct positive dimensions - I suppose this is the option here since the Rectangle class is part of pixijs, not pixi-viewport.
Second, mouse wheel and touch events don't work because in the InputManager.ts, line 237, there's a hardcoded assumption that the Y axis points down (y > top and y < bottom). I would assume this check should be simply if (viewport.hitArea.contains(point.x, point.y)), provided the issue above is fixed too.
I need to have the Y axis point upwards, and the only sensible way I found to do this is just to set negative scale to it.
Apparently this needs to be done to
viewport
and not the app stage. This effectively rotates everything around the X axis, and my coordinate system is what I wanted. What is happening now though is that zooming, panning and all other mouse interactions stop working - I'm not getting any exceptions, there's simply no reaction to any mouse movements.The text was updated successfully, but these errors were encountered: