[UPDATED: 27.03.2018] The Big NW.js Roundup - Tips & Tricks

Discussion and feedback on Construct 2

Post » Fri Dec 08, 2017 4:32 pm

TheRealDannyyy wrote:
bclikesyou wrote:Image

Just updated to the nw.js 27.0 and I'm getting this error on preview. I'm guessing it's because of the Steam4C2 plugin I'm using? I removed it from the project but it still happens.

EDIT: I started a new project which previewed fine with nw.js. So I'm guessing it must be some third party plugin in my project.

Can reproduce, the plugin seems to be at fault. Works fine when exporting the game.
Reported here: nw-js-plugin-broken-in-preview-v0-27-0_t198544


Dude you're a legend. I totally forgot to add the nw.js plugin in my empty project test. Good call on that. Reproducing it over here as well.
B
46
S
13
G
3
Posts: 279
Reputation: 4,631

Post » Mon Dec 11, 2017 7:09 pm

Updated the Roundup with the following changes [11.12.2017]:
  • <Added> How To: Workaround Steam Overlay Not Appearing (Constant Refresh)
  • <Added> How To: Workaround Steam Overlay Not Appearing (In-Process)
  • <Added> How To: Open Multiple NW.js Preview Windows
  • <Unresolved> NW.js Window Size Bug (Link)
  • <Unresolved> NW.js Mouse Pointer Problem When Right-Clicking (Link)

Cheers!
ImageImageImage
B
81
S
30
G
78
Posts: 752
Reputation: 46,393

Post » Thu Jan 25, 2018 8:42 pm

Linux NWjs Webfonts Problem & Solution:

Problem:
When using webfonts with NWjs on Linux, the fonts don't apply & everything is times new roman (or your computers default font)

Why:
This is because for some reason on Linux when extracting the font files they will be downcased (ie Fun-Font.woff -> fun-font.woff).

Solution:
To fix this, simply rename your fonts (and the names in the associated css file) to be all lowercase in the first place!

Webfont tutorial:
https://www.scirra.com/tutorials/237/ho ... fonts#h2a6

Notes:
I dont really know if this is a Linux or NWjs thing, but the workaround is easy enough...
B
15
S
4
Posts: 21
Reputation: 1,007

Post » Fri Jan 26, 2018 5:28 am

JhomasJhomas wrote:Linux NWjs Webfonts Problem & Solution:

Problem:
When using webfonts with NWjs on Linux, the fonts don't apply & everything is times new roman (or your computers default font)

Why:
This is because for some reason on Linux when extracting the font files they will be downcased (ie Fun-Font.woff -> fun-font.woff).

Solution:
To fix this, simply rename your fonts (and the names in the associated css file) to be all lowercase in the first place!

Webfont tutorial:
https://www.scirra.com/tutorials/237/ho ... fonts#h2a6

Notes:
I dont really know if this is a Linux or NWjs thing, but the workaround is easy enough...

Doesn't Construct 2 lowercase all filenames from external files on export by default?
I remember it doing that but if not I will add this as a workaround soon.

Thanks for the heads up!
ImageImageImage
B
81
S
30
G
78
Posts: 752
Reputation: 46,393

Post » Tue Jan 30, 2018 10:57 am

Good Job @TheRealDannyyy;
Global.gc (); only unload the audio from memory?
B
47
S
11
G
2
Posts: 47
Reputation: 6,030

Post » Tue Jan 30, 2018 11:29 am

maxlive2010 wrote:Good Job @TheRealDannyyy;
Global.gc (); only unload the audio from memory?


Thanks and Global.gc (); is actually the same as pressing the bin icon in the browser console.
Basically everything that's in the queue (mostly audio) will be unloaded instantly.

It's a very powerful feature which unfortunately doesn't get enough attention from NW.js users.
ImageImageImage
B
81
S
30
G
78
Posts: 752
Reputation: 46,393

Post » Fri Feb 02, 2018 1:34 am

With NW.js is there a way to check for parameters. For example "nw.exe console-on" where a param can enable a console.
B
94
S
18
G
9
Posts: 2,457
Reputation: 15,177

Post » Fri Feb 02, 2018 11:08 am

jayderyu wrote:With NW.js is there a way to check for parameters. For example "nw.exe console-on" where a param can enable a console.

I asked Armaldio for help regarding this and he managed to figure out the code and gave me THIS example.
It's fairly simple to use and makes it possible to check for a specific command line argument to enable something like a "devconsole" in your games.

(Great feature for Steam by the way, which makes it possible to define "launch options" in the properties menu. Feels just like enabling the ingame console for Half Life in the old days. 8-) )
ImageImageImage
B
81
S
30
G
78
Posts: 752
Reputation: 46,393

Post » Sun Feb 04, 2018 3:44 am

@TheRealDannyyy
Thanks, that helps a lot.
B
94
S
18
G
9
Posts: 2,457
Reputation: 15,177

Post » Wed Feb 14, 2018 1:18 am

Image
  • <Added> How To: Fetch & Make Use Of Command-line Arguments
  • <Other> Cleaned up the topic and simplified stuff (no walls-of-text anymore)

Cheers!
ImageImageImage
B
81
S
30
G
78
Posts: 752
Reputation: 46,393

PreviousNext

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 4 guests