Browser.ScreenWidth/Height iOS issue

0 favourites
  • 2 posts
  • Hi,

    it is not really a bug, but an unwanted behavior.

    Problem Description

    The Browser Plugin Expressions ScreenWidth and ScreenHeight do not work correctly. The Values are correct, but not the orientation. On iOS the ScreenWidth Value is always the ScreenWidth in portait also if the phone (iPhone 5s) is on landscape. e.g. on iOS 320x568 regardless to the orientation.

    A workaround: check the orientation and switch the values between width and height. e.g. on landscape width is always greater than height.

    But why is the browser screen size on iOS different as on desktop. Perhaps you should change that in the plugin, Ashley.

    Attach a Capx

    Download here

    Description of Capx

    Just re/load the project to see the screen size of browser plugin on the left (top) side.

    Steps to Reproduce Bug

    Use Landscape Orientation!

    • Run it on the desktop (window 8.1 testet with chrome)
    • Run it on iOS (8.3 safari and / or cordova)

    Observed Result

    The screen size on iOS is always in portrait orientation. regardless on landscape mode.

    Expected Result

    The Width on landscape must be greater than the Height. But iOS only returns the portait size.

    Operating System and Service Pack

    Windows 8.1 and iOS 8.3 (iPhone 5s)

    Construct 2 Version ID

    r200

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The Browser object just returns what the browser says the screen width and height are, so I'm not sure we should change it to deviate from what the browser says. Arguably it is correct: the physical screen is not actually changing size when you change the orientation, just the display mode. I guess it's more like "return the physical size of the display". So closing as won't fix.

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