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
2
Posts: 2
Reputation: 154

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
70
S
27
G
32
Posts: 474
Reputation: 19,569

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...??
B
68
S
17
G
65
Posts: 2,186
Reputation: 41,312

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
2
Posts: 2
Reputation: 154

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
54
S
21
G
16
Posts: 82
Reputation: 12,005

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
122
S
31
G
17
Posts: 1,468
Reputation: 19,955

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
54
S
21
G
16
Posts: 82
Reputation: 12,005

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
122
S
31
G
17
Posts: 1,468
Reputation: 19,955


Return to Construct 2 General

Who is online

Users browsing this forum: Havok, MadSpy and 7 guests