[Suggestion] C2 Preview Using Multiple Windows (+Nw.js bug?)

0 favourites
  • 3 posts
From the Asset Store
With this template you will learn how to use the GooglePlay Games native plugin
  • Hello there!

    I'm currently struggling with a minor previewing issue. I'm working on a multiplayer based game for a while now.

    This basically means that I have to open 2 preview windows each time, when I want to test out the new things that I've added.

    C2 unfortunately, as far as I know doesn't offer a shortcut icon or specific option to open another preview window, while maintaining the existing one.

    However, I've found a workaround by using the browser plugin to open a new localhost window which works on almost all browser except NWjs.

    Since I'm aiming to release the game using NW.js as the endproduct, I would also like to be able to preview with the endproduct.

    I'm not 100% sure if this is a bug by NWjs or the way that C2 handles previews with NWjs but the bug is basically that the second window opened with the browser plugin, totally bugs out on my end and flickers in black and white all the time. (On start of layout > Open new window [param = "localhost URL"])

    To sum it up, an additional icon or shortcut (key + click on preview) to open a new preview window while maintaining the existing one would be amazing!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Using an appropriate trigger event so this won't happen during the final version of the game...

    Browser: Execute Javascript:

    "// Load native UI library
    var gui = require('nw.gui');
    
    //open a new window to localhost
    var win = gui.Window.open ('http://localhost:50000/', {
      position: 'center',
      width: 480,
      height: 270
    });"[/code:15wj66en]
    
    This is the 'with options' version of the javascript that is detailed [url=https://github.com/nwjs/nw.js/wiki/window]here[/url] in the nw.js github wiki.  Works like a champ - and both windows will close at the same time too.
  • Using an appropriate trigger event so this won't happen during the final version of the game...

    Browser: Execute Javascript:

    > "// Load native UI library
    var gui = require('nw.gui');
    
    //open a new window to localhost
    var win = gui.Window.open ('http://localhost:50000/', {
      position: 'center',
      width: 480,
      height: 270
    });"[/code:2ookrr72]
    
    This is the 'with options' version of the javascript that is detailed [url=https://github.com/nwjs/nw.js/wiki/window]here[/url] in the nw.js github wiki.  Works like a champ - and both windows will close at the same time too.  
    

    Not working for me, the 2nd window says: "This site can’t be reached localhost refused to connect."

    EDIT: It worked, I just had to change the localhost IP. They don't close at the same time as you said but they work and that is all I asked for, thanks!

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