Jump to content

Scrolling only part of the view


quarks
 Share

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.

Thanks.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

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