Help with fitting my game to all iOS Devices ? (resolution , object position)

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • Hey,

    I need help with resolution in my game. I’m creating game for iOS and before iPhone X was released everything was good. Now I have to filled all frame space.

    I use on my project – portrait - resolution 320 x 480. My frame resolution is 360 x 693. I use on my project „Display properties” for iOS – Fit inside and adjust window size, so my game should be fitted to all Apple devices (iPhone X, iPhone , iPad).

    1. How Can I identify the type of device ? I would like to events like -> If this device is iPhoneX (Condition -> Set object „Player” position on X or Y coordinate). Is it possible ?
    2. Does anyone have an idea how Can I Set Camera on the centrer of the screen (x coordinate) and on the bottom (Y Coordinate) without using Center Display at …. ? (When I'm not using Center Display at.... then I can't see right part of the display.
    3. How to properly arrange active objects depends on the type of device or display ? ( I use Set X Coordinate to X Right Frame / 2 but it is not working when my width resolution is 320 px. It is working only when width resolution is 360 px.
    4. I prepared example with my problem. You have to change project resolution to 320 x 693 or 320 x 569 or 360 x 693 and then you’ll see what I mean. You have to click on the black Player object then green object sholud be set on the center of the screen. ->>>> Please login to see this link. <<<<-
    5. Is it possible to determine the position of the camera without events ?

    Please login to see this picture.

    Please login to see this picture.

    Please login to see this picture.

  • To position the display window in the horizontal center and bottom of the frame, the easiest way is to position a dummy active object at the desired location in the frame, and then center the display at 0,0 from that active object.

    To center an object horizontally in the display window, you need to know the position in the frame of the left and right edges of the display window, and do some basic maths.

    Formula to get the horizontal center of the display window in the frame:

    Code
    X Left Frame + ( X Right Frame - X Left Frame ) / 2

    Formula to get the vertical center of the display window in the frame:

    Code
    Y Top Frame + ( Y Bottom Frame - Y Top Frame ) / 2

    X Left Frame, X Right Frame, Y Top Frame and Y Bottom Frame are expressions of the Storyboard Controls object (a system object). They return respectively the horizontal position in the frame of the left and right edges of the display window, and the vertical position in the frame of the top and bottom edges of the display window.

    Edited 3 times, last by Olivier (October 23, 2017 at 2:36 PM).

  • -> Olivier

    Thank you for your help. I tried you idea with Active Object and Center Frame for this object before I posted on forum but it did not solve my problems.

    I deleted conditions " Center Display at ... " and use for all objects conditions:
    X Left Frame
    X Right Frame
    X Bottom Frame
    X Top Frame

    When I don't use "Center Display at..." form Storyboard Controls everything works great. I tried my app on iOS Simulator and Real Device with my resolutions and I found good solution for it ( I set counter to Y Bottom Frame and X Right Frame. Then I tested this small app on all iOS Devices - simulator - and checked real resolutions).

    Below I show you my solution. Using these events I can fit everything in my game. About resolution (portrait):
    360 x 480 - for all iPads
    320 x 567 - for iPhone SE and 5S
    320 x 567 - for iPhone 6,7,8
    320 x 568 - for iPhone 6 Plus, 7 Plus , 8 Plus
    320 x 692 - for iPhone X
    320 x 693 - for iPhone X


    Please login to see this picture.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!