iPhone XR & XSMAX Showing black bars on its sides on Landscape Mode.

0 favourites
  • 11 posts
From the Asset Store
A small template showing how to build a firebase ranking
  • Problem description :-

    Construct 3 r128

    iPhone XR & iPhone XS MAX

    Showing black bars on its sides on landscape mode.

    In my project with a Viewport Size :- 960*640 & Aspect Ratio :- 3:2, when i build the project into Landscape mode it shows black bars on iPhone XR & iPhone XS MAX,

    But when i build it into Portrait mode it seems to show no black bars on iPhone XR & iPhone XS MAX (i.e. when i change the Device Orientation in Xcode settings to Portrait & Landscape and build it, the device in the Xcode simulator displays with no black bars) so it means portrait mode is working fine in construct and landscape mode faces some issues.

    Kindly help me out on this issue.

  • I found a solution to the problem.

    In Xcode, Open C2runtime.js file and use the search to find the line that starts as " this.isiPhoneX = this.isiPhone & & " and replace it with

    "

    this.isiPhoneX = this.isiPhone && screenWidth === 1125 || screenWidth === 750 || screenWidth = = 828 || screenWidth = = = 1125 || screenWidth = = = 1242 && screenHeight = = = 2436 || screenHeight = = = 1624 || screenHeight = = = = 2436 | screenHeight = = = = 1792| screenHeight = = = = 2688; | slightly unpleasant test for iPhone x
    

    "

    This works for me.

  • BUGStudio

    Thanks for your reply,

    Opened the c2runtime.js file in Xcode but there are no such line " this.isiPhoneX = this.isiPhone & & " in the c2runtime.js file, please help me out.

  • BUGStudio

    Thanks for your reply,

    Opened the c2runtime.js file in Xcode but there are no such line " this.isiPhoneX = this.isiPhone & & " in the c2runtime.js file, please help me out.

    You don't have to minifi C2runtime, then you will be able to find this place.

  • BUGStudio

    Hey,

    In Xcode, I Opened the C2runtime.js file  and change the Line starts as “this.isiPhoneX = this.isiPhone & & " as per you said to this :-

    this.isiPhoneX = this.isiPhone && screenWidth === 1125 || screenWidth === 750 || screenWidth = = 828 || screenWidth = = = 1125 || screenWidth = = = 1242 && screenHeight = = = 2436 || screenHeight = = = 1624 || screenHeight = = = = 2436 | screenHeight = = = = 1792| screenHeight = = = = 2688; | slightly unpleasant test for iPhone x

    (But there is nothing displaying in the simulator on all IOS devices but full black screen appears and the game doesn’t run.)

    So I tried to change the line with this :-

    this.isiPhoneX = this.isiPhone && screenWidth === 1125 && screenHeight === 2436 || screenWidth === 750; screenHeight === 1624 || screenWidth === 828; screenHeight === 2436; screenWidth === 1125 && screenHeight === 1792; screenWidth === 1242 && screenHeight === 2688; // slightly unpleasant test for iPhoneX

    (There is no change the device seems to show black bars on the right side of it.)

    And by applying iPhone XR screen resolution :-

    this.isiPhoneX = this.isiPhone && screenWidth === 1792 && screenHeight === 828; // slightly unpleasant test for iPhone X

    (shows black bar on the right side of the device).

    Please help me out of this issue.

  • After you add my line to the application code, the display of the game on the "Simulators" will be broken, but everything will be fine on the real device.

    My photo shows iPhone xr simulator And Real iPhone xr device.

    This code has also been tested on Iphone X, Iphone 6s, Iphone 7 Plus and Ipad Air 2 and everything works fine.

  • BUGStudio

    Thanks for the reply,

    Should i copy and paste your code as it is or need to make some changes in the code you have given above.

    This is what i get when i insert your code in the simulator and on my iPhone X,

  • BUGStudio

    what is the aspect ratio and viewport size have you used in your project.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • BUGStudio

    I tried inserting this line of code and checked it on real devices it does show black bars on the devices, Please do help me out to solve this issue.

    If you need any charges i am ready to pay you.

    Kind regards,

    Bryan

  • BUGStudio

    I tried inserting this line of code and checked it on real devices it does show black bars on the devices, Please do help me out to solve this issue.

    If you need any charges i am ready to pay you.

    Kind regards,

    Bryan

    I rarly go to the forum.

    Please contact me via e-mail supportztw@bug-studio.net

  • How to be with Construct 3 ???

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