Strange behavior with resolution

Report Construct 2 bugs here.

Post » Fri Jan 06, 2017 12:03 am

Problem Description
It could be that resolutions like 400x240 are not being defined correctly by C2.
This resolution behaves strangely when running on a mobile device an apk created with C2 that uses this resolution, the problem is that sometimes occupy the full screen (with small margins only to the sides, this is normal due to the Resolution) and other times it does not occupy the full screen (then you create margins up and down and also margins the sides obviously). This problem occurs on the same mobile device.

That is, the application will run full screen or it will not, it seems a matter of luck. If the application runs full screen, then you run the risk of losing the full screen if you use "close all" on android. Then something is causing the application to run without full screen.
I've been talking to the XDK guys about this problem, they say it's probably due to the way C2 defines the view, so I'd like to check if this can be checked by the C2 team, I have made and finished a game and it is affected by this problem..

Url of thread in Intel forums:
https://software.intel.com/en-us/forums/intel-xdk/topic/706798#comment-1894718

Here you can see the correct shape with full screen and small margins on the sides:

http://i.imgur.com/XVEd14e.png

And here once the error occurs in the loss of the full screen:

http://i.imgur.com/ihdoo2L.png

This also happens in WebView so it makes you think it's a C2 problem.

Attach a Capx

https://dl.dropboxusercontent.com/u/60803633/testNSRPantallaCompleta4.capx

APK of the capx
https://dl.dropboxusercontent.com/u/60803633/400x240.apk

Description of Capx
The file is only a blank layout ready to compile in XDK, the file uses the resolution 400x240 which is the motive of this report.

Steps to Reproduce Bug
- Run the apk on a mobile device.
- See if there is a full screen.
If there is no full screen then the full screen should be turned on and this would be the problem.
If there is a full screen, then click on "close all" at different times with the application in the background, for this you will have to open the application several times clear, then when you re-run the application it is possible that the full screen is lost and Now it is not seen in full screen.

In this video you can see how the test is initially displayed in full screen, then press "close all" and when I run the test again, the full screen is lost.
In this video the error occurs on the first attempt.

https://www.youtube.com/watch?v=L6CAro8-6Pc

Observed Result
The full screen with an apk that uses the 400x240 resolution is not guaranteed, it is likely to get it or you probably will not get it.

If you get it, then when you do "close everything" on android, you will probably lose the full screen and the next time you run the app you will not be able to enjoy it in full screen.

Expected Result
The application or game should always preserve the full screen and run that way.

Affected Browsers
  • Chrome: (YES/NO)
  • FireFox: (YES/NO)
  • Internet Explorer: (YES/NO)

Operating System and Service Pack
win7 64bits sp1

Construct 2 Version ID
R241 64bits
Last edited by The Mnk on Tue Jan 17, 2017 8:19 am, edited 2 times in total.
B
29
S
12
G
20
Posts: 756
Reputation: 13,855

Post » Fri Jan 06, 2017 9:46 am

Have you tried Letterbox scale instead of Letterbox integer scale in the C2 settings?
B
24
S
3
G
1
Posts: 451
Reputation: 2,165

Post » Fri Jan 06, 2017 10:48 am

Asmodean wrote:Have you tried Letterbox scale instead of Letterbox integer scale in the C2 settings?


I have generated almost 100 test apks with different options in real device, plugins, crosswalk and webview. The problem was never solved.

Sometimes it seems solved but maybe the next day it happens again and the full screen is lost.
B
29
S
12
G
20
Posts: 756
Reputation: 13,855

Post » Fri Jan 20, 2017 3:06 pm

You didn't answer the question - does it still reproduce with letterbox scale (not the integer version)?

400x240 doesn't fit exactly in to a 1920x1080 display, so the black borders are to be expected in that case. On the other hand if the resolution does fit that exactly, then there should be no borders. So to figure out which one is the bug, what is the resolution of the device you are testing on?

Also one thing you can do to find out more: display the Browser plugin's WindowInnerWidth and WindowInnerHeight expressions on the screen and see what they say in both cases. If they change, it's probably a browser bug, and is caused by the browser telling C2 the wrong window size. On the other hand if they're always the same even in both cases, it's probably a C2 bug. Could you give that a shot?
Scirra Founder
B
387
S
230
G
87
Posts: 24,248
Reputation: 192,228

Post » Sat Jan 21, 2017 9:09 am

Ashley wrote:You didn't answer the question - does it still reproduce with letterbox scale (not the integer version)?

400x240 doesn't fit exactly in to a 1920x1080 display, so the black borders are to be expected in that case. On the other hand if the resolution does fit that exactly, then there should be no borders. So to figure out which one is the bug, what is the resolution of the device you are testing on?

Also one thing you can do to find out more: display the Browser plugin's WindowInnerWidth and WindowInnerHeight expressions on the screen and see what they say in both cases. If they change, it's probably a browser bug, and is caused by the browser telling C2 the wrong window size. On the other hand if they're always the same even in both cases, it's probably a C2 bug. Could you give that a shot?


Resolution of my galaxy 6s 1440x2560
I'm pretty sure I tried letterbox scale but I'll try again, although I do not like that scaling mode.
I'll try everything you say as soon as I can.
B
29
S
12
G
20
Posts: 756
Reputation: 13,855

Post » Sun Jan 22, 2017 11:17 am

Okay, this is the information I bring.

-The error occurs when you use letterbox integer scale, sorry if there was confusion before.

-When the error occurs (with LIS) the resolution shown by the browser object and the WindowInnerWidth and WindowInnerHeight property is the same.
640x360

Capture without error:
Http://imgur.com/pyOub5V

Capture with the error, you can see the same resolution.
Http://imgur.com/sD0Z3r4


- It also happens (with LIS) that when you start the game, sometimes a dark bar appears at the bottom of the screen.
On this occasion the resolution is different.
To solve it you have to send the game to the background and recover it again or close it and open it again.

Http://imgur.com/zGB8F7v

You can see that the captures are the size of the resolution of my phone galaxy 6s 1440x2560

- With letterbox scale mode the error does not seem to happen, but this is not the solution because the scaling is different from letterbox integer scale and there are visual differences.


**All tests with WebView.
B
29
S
12
G
20
Posts: 756
Reputation: 13,855


Return to Bugs

Who is online

Users browsing this forum: No registered users and 1 guest