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

Bugs will be moved here once resolved.

Post » Mon Jun 16, 2014 10:28 pm

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
B
71
S
30
G
25
Posts: 984
Reputation: 19,503

Post » Tue Jun 17, 2014 7:18 pm

Yep.

This is 720
Image

And this is 1080
Image

What about if you use normal "LetterBox Scale" instead "LetterBox Integer Scale"?
B
89
S
28
G
11
Posts: 652
Reputation: 11,428

Post » Wed Jun 18, 2014 12:59 am

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.
You do not have the required permissions to view the files attached to this post.
B
71
S
30
G
25
Posts: 984
Reputation: 19,503

Post » Wed Jun 25, 2014 2:25 pm

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.
Scirra Founder
B
397
S
236
G
88
Posts: 24,418
Reputation: 194,540

Post » Sun Jun 29, 2014 12:28 am

@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 ?
B
71
S
30
G
25
Posts: 984
Reputation: 19,503

Post » Sun Jun 29, 2014 12:26 pm

@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.
Scirra Founder
B
397
S
236
G
88
Posts: 24,418
Reputation: 194,540

Post » Sun Jun 29, 2014 9:39 pm

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 :
Image
B
71
S
30
G
25
Posts: 984
Reputation: 19,503

Post » Sat Jul 05, 2014 11:10 pm

@Ashley You might be interested in this, I added the following CSS rule in index-phone.html
Code: Select all
@-ms-viewport {
    width: 640px;
}

And suddenly it started behaving as intended. The DevicePixelRatio get ajusted correctly, and so are the width and height.
You do not have the required permissions to view the files attached to this post.
B
71
S
30
G
25
Posts: 984
Reputation: 19,503


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 3 guests