quarks Posted March 13, 2016 Share Posted March 13, 2016 Can anyone suggest a way to restrict the scrolling view of the world to a rectangular "window" smaller than the Phaser canvas. Think of something like viewport of spaceship with a border containing UI elements drawn around it. I know that one way to achieve this would be to mask the "space" layer with a layer (i.e. Group) with the UI elements and make it fixedToCamera. But that feels kludgy to me. As an alternative, would it be possible to put all the aliens and whatnot in space part of a fixedtoCamera "viewport" group and just scroll withinthe group? Or more to the point, is there a way to effect that scrolling without having to manually adjust the coordinates of every element within the viewport group. It seems like there should be a way to do it by adjusting the viewport origin somehow, but I'm having trouble wrapping my head around how the coordinate systems and transforms interact. Thanks. Link to comment Share on other sites More sharing options...
drhayes Posted March 14, 2016 Share Posted March 14, 2016 I was gonna suggest your solution: mask the space layer with something fixedToCamera so there's only a little window. When you restrict to that window, is it like a cutscene, or game UI, or what? Link to comment Share on other sites More sharing options...
Recommended Posts