How do I create objects at the border of the screen instead of layout?

0 favourites
  • 3 posts
From the Asset Store
Hand-painted tiles, objects, animated objects, and background to build a colorful Mayan civilization environment.
  • Hi,

    I'm having problems with different screen sizes on mobile.

    My game is made as

    16:9 Landscape 854 x 480

    Viewport Fit Auto (also tried cover)

    Full Screen Mode Scale Outer

    The problem is that I have objects that I'm spawning at the border of the layout to the left towards the right... but when facing a non standard screen ration like the Pixel 3a 1080x2220 The game covers the whole screen BUT the when creating objects at the border of the layout the layout don't start at the beginning of the screen.

    In the screenshots you can see a checkered pattern that's the size of the layout.

    Here are some screenshots:

    And here is a video:

    Subscribe to Construct videos now

    So my question is how to be able to always create objects at the border of the screen?

    Sorry if I missed something really obvious.

    Regards

    E

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • when you use scale outer the layout is extended to fill the screen, so the top left corner will not be 0,0

    you can use ViewportLeft(Layer#) to get the x coordinate of the left edge (probably will be a negitive number).

    ViewportRight(layer#) will give you the right edge.

    ViewportTop and ViewportBottom give the y coordinates.

  • Thanks! Yeah I found that just after I wrote this post... changed all the Layout coordinates to Viewport.

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