How do I increase layout size midgame?

0 favourites
  • 12 posts
From the Asset Store
220 Food Sprites in 16x16 pixel size. Perfect for items for a retro style game.
  • This one is a bit of a hassle. I have a space shooter game, and I'm planning on making a boss. When the boss appears I want the game to zoom out, which I have done successfully, but when I'm playtesting the game I find myself to be circling around all the time, and I would prefer to have bigger space to fight in, but having too much space in the non-boss parts of the game ruins it. So I was wondering if I could do something along the lines of increasing the layout size mid-game for when the boss appears.

    Thanks in advance!

  • Yes, use the "set canvas size" action

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Yes, use the "set canvas size" action

    Thank you, but there seem to be some other problems following this.

    First off, the HUD is all messed up. The HUD in my game is a layer on top with parallax 0%.

    The second problem might be the reason of the first. I have a scrollto camera on my character, however once I do the Set Canvas Size it seems to be fully zoom out to show the whole canvas.

    The third problem is that there are still boundaries on places where the last canvas was set, so I can't move over to the new area of the canvas.

  • You can't change the layout size in run-time.

    You should make the layout as big as you need it and limit the view and player's movement to whatever bounds you need.

  • You can't change the layout size in run-time.

    You should make the layout as big as you need it and limit the view and player's movement to whatever bounds you need.

    I tried something along those lines, but it's quite hard. You got any ideas to how I could do this properly?

  • Enable "unbounded scrolling", which gives you an effectively unlimited layout area. Then you can impose your own custom scrolling boundaries that can change in events.

  • Enable "unbounded scrolling", which gives you an effectively unlimited layout area. Then you can impose your own custom scrolling boundaries that can change in events.

    Interesting! I'll try that out later today and then let you know how it goes! Thank you!

  • Enable "unbounded scrolling", which gives you an effectively unlimited layout area. Then you can impose your own custom scrolling boundaries that can change in events.

    The unbounded scrolling effect seems quite handy for this situation. I'm just a bit confused on how I can set scrolling boundaries. Any ideas?

  • how I can set scrolling boundaries.

    It depends on how you do the scrolling. If you are changing scrollx/scrolly with events, you can simply add clamp:

    Set scroll X to clamp(scrollx, -1000, 3000)

  • It depends on how do you do the scrolling.

    I scroll using the ScrollTo behavior on the playable character.

  • You'll have to disable it and use an event like this instead:

    On Every Tick
    Scroll To X:clamp(Player.x, -1000+ViewportWidth(0)/2, 3000-ViewportWidth(0)/2),
     Y:clamp(Player.Y, 0+ViewportHeight(0)/2, 1000-ViewportHeight(0)/2)
    

    Where the numbers are the virtual bounds of your level or map.

  • Alright, that worked! Thank you and everyone else who helped me with this!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)