Jump to content

Scrolling only part of the view


Recommended Posts

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.


Link to comment
Share on other sites


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...