How do I Center The Layout on The Mobilephone Screen?

Not favoritedFavorited Favorited 0 favourites
  • 6 posts
From the Asset Store
40 short musical loops, perfect for playing in the background on different screens.
  • Hello,

    Nowadays, many mobile phones have a 20:9 aspect ratio while Construct 3 defaults to 16:9.

    I use FullScreen Mode -> Scale Outer to cover the screen so that the edges of the screen are not black.

    Unfortunately, the layout is not centered, so it doesn't look good.

    How to center the layout on the screen?

    Tagged:

  • It's probably because of the camera notch. Change the "Viewport fit" in project properties to "cover"

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • My test result,

    I just know cover mode in Viewport fit make game more wider, it's good. But layout still not in center.

    Sorry I have difficulty explaining in English. Maybe picture below can explain it.

  • Enable Unbounded scrolling on all layouts. You might need to test that the game is scrolling properly after that.

  • It's works. Thanks.

    I check player can't use scroll-to behavior. Background will be messy. I used parallax background.

  • You can limit scrolling to layout with events:

    + System: Every tick
    -> System: Set scroll X to clamp(ScrollX, 0+ViewportWidth("layer")÷2, LayoutWidth-ViewportWidth("layer")÷2)
    -> System: Set scroll Y to clamp(ScrollY, 0+ViewportHeight("layer")÷2, LayoutHeight-ViewportHeight("layer")÷2)
    

    Where "layer" is a layer with 100% parallax.

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