Feature request: NW.js window size settings

Discussion and feedback on Construct 2

Post » Fri May 22, 2015 11:56 am

The way window size works right now is it includes the window borders when you set resolution. So if I set window size to 320x256 in Windows 7 it'll fit the window borders inside that resolution so the actual game window is only 304x218. Problem is, window border size varies between OS'es, Windows versions, and theme settings so it's impossible to make sure the game always runs at the same resolution in windowed mode. If I run the same 320x256 res in classic mode for instance, the game resolution is suddenly 312x218.

It would be great if we had an alternate window size setting that made window borders expand to fit the game resolution instead of the other way around.
B
40
S
16
G
6
Posts: 543
Reputation: 7,649

Post » Fri May 22, 2015 3:30 pm

You just have to calculate the size of the border and add it to the final window size. Set 2 global vars to the native resolution, then subtract that from the retrieved window size.
Last edited by Tokinsom on Sat May 23, 2015 10:03 pm, edited 1 time in total.
Image
B
243
S
30
G
13
Posts: 1,787
Reputation: 18,770

Post » Sat May 23, 2015 8:26 pm

Thanks :)
B
40
S
16
G
6
Posts: 543
Reputation: 7,649

Post » Sat May 23, 2015 8:54 pm

Tokinsom wrote:You just have to calculate the size of the border and subtract it. Set 2 global vars to the native resolution, then subtract that from the retrieved window size.


Could you reword or dumb this down for me please? Or make a project file of it, if that's not too much to ask.
FREEDOM: Diegesis - Out Now for Windows! http://freedom.quicksandgames.com
B
22
S
5
G
1
Posts: 83
Reputation: 1,818

Post » Sat May 23, 2015 10:48 pm

Fisholith made an example here:

nw-js-object-and-window-sizes_t145083
B
40
S
16
G
6
Posts: 543
Reputation: 7,649

Post » Mon May 25, 2015 2:07 am

ErekT wrote:Fisholith made an example here:

nw-js-object-and-window-sizes_t145083


Thanks to you and them, then.
FREEDOM: Diegesis - Out Now for Windows! http://freedom.quicksandgames.com
B
22
S
5
G
1
Posts: 83
Reputation: 1,818


Return to Construct 2 General

Who is online

Users browsing this forum: Yahoo [Bot] and 8 guests