How do I see outside the layout

0 favourites
  • 3 posts
  • Hi there!

    I’m looking for a simple and smart way to auto-size my game on different devices. So, the game is primarily designed for iPhone 5 and up which means the game is built on a resolution of 640x1136, and is in portrait. When played on higher resolution devices of the same aspect ratio, such as the iPhone 6+, everything scales up fine.

    The problem is with iPads since they have a wider aspect ratio, and while the game still scales to fill the screen as much as possible, there’s black bars by the sides of it.

    Here’s my solution, but I don’t know if it’s possible since whatever I tried so far hasn’t worked. Without changing the resolution of the whole game (since that’s going to break everything and require time I don’t have), I’m wondering if these black bars on either side of the game can be removed, revealing a sprite behind them (placed outside of the layout) which looks like an extension of some buttons, and can be tapped on. So whatever width greater than 640, the game will automatically scale up to fill the screen and reveal part of this sprite.

    Here’s a basic diagram to help visualise what I’m trying to explain:

    https://www.dropbox.com/s/5pnqco54w12s4 ... m.jpg?dl=0

    So imagine it like a pinball table (which the game isn’t!). You see inside the all of the table when at aspect ratio of iPhone 5 and above. But when the aspect ratio is wider, you see outside of the table (the floor/walls etc.). Hope that makes sense <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy">

    With this idea, I don’t see a need to detect the device width and manually resize the game and shift all the sprites across by X. I’m actually hoping I won’t even need to touch the code! I figure if it’s doable it must be something to do with the “window”, “layout”, “margins” settings etc. so that when the game scales up automatically, the back bars are not shown, instead it just sees outside of the layout (so I don’t have to change positions of any sprite in the game based on the device width, which is a massive undertaking…).

    Off to sleep now but will check the thread tomorrow!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You need to scale the game slightly oversized. Check out this tutorial my help. https://www.scirra.com/tutorials/998/screen-resolution-for-mobile

  • You need to scale the game slightly oversized. Check out this tutorial my help. https://www.scirra.com/tutorials/998/screen-resolution-for-mobile

    Sorry for the late reply, but thanks for that link! It was not the video itself that made it work, since that required changing the size of the layout which can't really be done this late into development without costing a lot of time. But one of the comments! I simply changed Unbounded Scrolling to Yes on all layouts and FullScreen in Browser to Scale Outer, and magically, it worked!

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