nwjs start-up window size error

0 favourites
  • 11 posts
From the Asset Store
75 power-up sound effects; bonus and notification sounds, fanfares, harp glissandi, stabs, clock ticks, etc.
  • 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

  • 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.

  • For now uninstall NW.js and use an older version. It's up to them to fix it

  • 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.

  • The problem still exists~

    set1280,720 or else

  • 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.

  • nw.js v0.14.2

    r227

    windows10

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • winsonzhong, using r227 I find that it works correctly with nw v0.14.2 and nw v0.14.0....

  • 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.

  • Since you say it works in NW.js 0.14, closing as a NWjs issue.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)