nwjs start-up window size error

Bugs will be moved here once resolved.

Post » Wed Mar 23, 2016 6:31 pm

Problem Description

Update: To be confirmed; please test independently. Running this test in nw.js v0.14.0 and this bug was no longer apparent. May not be a c2 bug.


When nw.js initialises its size dimensions are set to the game's window size, which causes the internal canvas resolution to be smaller than that desired for the game.

Attach a Capx
capx link

Description of Capx
Simple layout with a text object to display the nw.js window size and the rendered on-screen canvas size.

Steps to Reproduce Bug
  • run layout in nw.js

Observed Result
The nw.js window initializes to the c2 window sizes, which does not account for the size of the nw.js window frame dimensions. Thus the rendered canvas size is less than that desired for the game. It is complicated and hackey to then resize the nw.js frame to achieve the desired canvas dimensions.

Expected Result
The nw.js window should initialise by default so that the displayed canvas is the same size/resolution as the game's desired window size.

Affected Browsers
  • nw.js

Operating System and Service Pack
W10 x64

Construct 2 Version ID
r225 running nwjs for c2 v13 rc4
Last edited by Colludium on Thu Apr 21, 2016 5:53 am, edited 3 times in total.
A big fan of JavaScript.
B
74
S
20
G
69
Posts: 2,205
Reputation: 43,832

Post » Wed Mar 23, 2016 6:46 pm

This is an annoying problem, yeah. I think you can change the NW.JS manifest file so that the window initializes at a larger size, but we shouldn't really have to. For my game I just had it add padding to the window size at the start of the first layout, but that's not really an elegant solution.
FREEDOM: Diegesis - Out Now for Windows! http://freedom.quicksandgames.com
B
22
S
5
G
1
Posts: 83
Reputation: 1,818

Post » Mon Apr 18, 2016 5:40 am

For now uninstall NW.js and use an older version. It's up to them to fix it
B
84
S
22
G
15
Posts: 1,039
Reputation: 15,249

Post » Mon Apr 18, 2016 9:02 am

Thanks @7Soul - I have no stress about this (won't for a few months yet) so I can bide my time. I just wasn't sure if this was a nw.js bug or if they had changed their api with the rollout of the new version.

Update:
I have updated the capx to include a couple of extra lines of info in the text object. Running in nw.js v0.14.2 nightly, this problem is no longer apparent - the correct canvas size is now being displayed. Probably worth closing as not a c2 bug.
A big fan of JavaScript.
B
74
S
20
G
69
Posts: 2,205
Reputation: 43,832

Post » Thu Apr 21, 2016 5:47 am

The problem still exists~

set1280,720 or else
B
37
S
11
G
1
Posts: 80
Reputation: 3,325

Post » Thu Apr 21, 2016 5:51 am

@winsonzhong - !

Which version of nw.js were you testing with? I'm away from my computer for a few days so it'll be a while before I can recheck what I've done.
A big fan of JavaScript.
B
74
S
20
G
69
Posts: 2,205
Reputation: 43,832

Post » Thu Apr 21, 2016 6:50 am

nw.js v0.14.2
r227
windows10
B
37
S
11
G
1
Posts: 80
Reputation: 3,325

Post » Thu Apr 21, 2016 6:32 pm

@winsonzhong, using r227 I find that it works correctly with nw v0.14.2 and nw v0.14.0....
A big fan of JavaScript.
B
74
S
20
G
69
Posts: 2,205
Reputation: 43,832

Post » Fri Apr 22, 2016 1:39 am

Image
B
37
S
11
G
1
Posts: 80
Reputation: 3,325

Post » Fri Apr 22, 2016 5:42 am

@winsonzhong, the displayed window is the correct size but I think that the returned values for nw window size and system window size are transposed. Print screen and measure the result to confirm.
A big fan of JavaScript.
B
74
S
20
G
69
Posts: 2,205
Reputation: 43,832

Next

Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 2 guests