Letter box integer scaling - Universal Windows 8.1+ (Phone)

0 favourites
  • 8 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • Problem Description

    There seem to be a weird behavior of the scaling while using "letterbox integer scale" when you export to Universal Windows 8.1 App, and run it on a phone. I tested both on an actual device and phone emulators.

    Note : It scales perfectly using the desktop version of Windows 8.1

    Attach a Capx

    https://dl.dropboxusercontent.com/u/700 ... aling.capx

    Description of Capx

    The attached capx as a window size of 640x360. Which is supposed to "integer scale" up to 1280x720 on both 720p and WXGA devices, and to 1920x1080 on 1080p devices. However, as you launch the app on said device, you'll notice the window size isn't scaling correctly at all. There's is a "debug" text object that get its text set to the current window size. What is weird is the fact that the canvas is definitely scaling, but absolutely not by an integer ratio (hence the bug).

    Steps to Reproduce Bug

    Open .capx

    Export to Universal Windows 8.1+

    Run on a 720p, WXGA or 1080p device/emulator

    Observed Result

    The window size is not a multiple of 640x360.

    Expected Result

    A window size of 640x360, 1280x720, 1920x1080, etc., depending on the device used.

    Affected Browsers

    Browsers unaffected, everything works as intended.

    Problem in a wrapped WP8.1 app.

    Works fine when launched as a Window 8.1 App

    Operating System and Service Pack

    Windows 8.1 FR

    Construct 2 Version ID

    Release 173

  • Try Construct 3

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

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

    This is 720

    And this is 1080

    What about if you use normal "LetterBox Scale" instead "LetterBox Integer Scale"?

  • Funny thing is "LetterBox Scale" seems bugged too, there's a small gap of 2 pixels on the right, and the text box shows "width : 1278, height 720"... so it skews the output ever so lightly.

  • I fixed some rounding errors and also got integer scale to base off device pixels instead of CSS pixels for the next build. I think this will fix it, the other emulators don't seem to start in VS for me apart from the default, so let me know how it works for you when r174 is out.

  • Ashley The weird scaling is gone, but now the problem is it's not scaling at all. Most certainly because the device width isn't fetched correctly. If you refer to the previous screenshot, you'll see the width that I get when I use normal scaling. 1278 for a 720p device, instead of the expected 1280. Seems like a bug on WP side, any workaround possible ?

  • Magistross - if you 'execute javascript' and show the values of window.innerWidth and window.innerHeight, what do they say? Also you should show the Browser.DevicePixelRatio value. That should be enough to work out if there really is room to integer scale it up. If the OS takes up any room then it won't have space to put the size up.

    If you still think there's an issue then best post another report since this one is closed now.

  • I don't know if it'll warrant a new report, but could you please Ashley take a look at this new screenshot and tell me if something's amiss ? Shouldn't innerWidth and innerHeight be the actual size of the device screen ?

    Actual screenshot from the 720p emulator, no cropping :

  • Ashley You might be interested in this, I added the following CSS rule in index-phone.html

    @-ms-viewport {
        width: 640px;
    }[/code:1ejc3kpf]
    And suddenly it started behaving as intended. The DevicePixelRatio get ajusted correctly, and so are the width and height.
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)