NW.js - remove right-click menu + custom icons

Discussion and feedback on Construct 2

Post » Wed Feb 17, 2016 12:49 pm

Hi,

I'd like to remove all traces of evidence that my Construct 2 project is running in a "browser".
I'm using NW.js (the latest version) and I want to get rid of the right click menu. (the one with these options:
Reload app
Simulate Browser Restart
Inspect
Inspect Background page)

I also want to use custom window and file icons.

Does someone know how to do this?

Thanks
B
4
S
1
Posts: 7
Reputation: 314

Post » Thu Feb 18, 2016 1:17 pm

For the last part: custom icons have to be added manually at this point.
You have to edit the "resources" of the exe-file (that's something like metadata in the header).

There are tools to do this, for example an old and trusty tool called "Resource Hacker".
B
79
S
29
G
32
Posts: 482
Reputation: 19,915

Post » Thu Feb 18, 2016 1:47 pm

Just change the images in the c2 project (under icons in the project menu). There you can replace the loading logo and the icons that are used for the game window. If you want to change the .exe icon then you'll need to convert one of those images to a .ico and use resource hacker to replace the one in nw.exe.

I don't have those options you listed when using right click...??
A big fan of JavaScript.
B
76
S
20
G
76
Posts: 2,287
Reputation: 47,558

Post » Thu Feb 18, 2016 6:55 pm

Thanks, you two.

I get the browser menu when I rightclick on the black part outside of the game's screen in NW.js (when giving the player the ability to resize the window)
B
4
S
1
Posts: 7
Reputation: 314

Post » Fri Feb 19, 2016 1:27 am

You could always add a small javascript <script> in your main HTML index file to disable right-clicking.
of course this doesn't really secure anything.. but it can hide the right-click context menu.

More info. http://stackoverflow.com/questions/7370 ... y-web-page

I did try this on one of my own test projects and it does effectively hide the right-click context menu.
B
84
S
38
G
22
Posts: 90
Reputation: 17,473

Post » Fri Feb 19, 2016 8:05 am

JaredX wrote:You could always add a small javascript <script> in your main HTML index file to disable right-clicking.
of course this doesn't really secure anything.. but it can hide the right-click context menu.

More info. http://stackoverflow.com/questions/7370 ... y-web-page

I did try this on one of my own test projects and it does effectively hide the right-click context menu.

This could work, but then you'll have to repack your game manually with NW.js, since first you'll need a HTML5 export to modify the code.
B
137
S
33
G
17
Posts: 1,560
Reputation: 20,797

Post » Fri Feb 19, 2016 8:43 am

glerikud wrote:
JaredX wrote:You could always add a small javascript <script> in your main HTML index file to disable right-clicking.
of course this doesn't really secure anything.. but it can hide the right-click context menu.

More info. http://stackoverflow.com/questions/7370 ... y-web-page

I did try this on one of my own test projects and it does effectively hide the right-click context menu.

This could work, but then you'll have to repack your game manually with NW.js, since first you'll need a HTML5 export to modify the code.


Really its a lot of work when you could just build your game around "scale inner" or "scale outer" and that would prevent the black bars in the first place and remove the option to right click for a context menu.
B
84
S
38
G
22
Posts: 90
Reputation: 17,473

Post » Fri Feb 19, 2016 3:02 pm

JaredX wrote:Really its a lot of work when you could just build your game around "scale inner" or "scale outer" and that would prevent the black bars in the first place and remove the option to right click for a context menu.

Yes, that's a way easier solution.
B
137
S
33
G
17
Posts: 1,560
Reputation: 20,797

Post » Sun Jul 02, 2017 5:49 pm

Sorry for the bump, but the solution is to use the non-dev version of NW, I believe.
B
4
S
1
Posts: 7
Reputation: 314


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 13 guests