Is It possible To Manipulate NW.js to Enable/Disable Certain Chromium Args Using JS?
837 views
Skip to first unread message
dannyy...@googlemail.com
unread,
Apr 15, 2018, 5:22:13 AM4/15/18
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to nw.js
Hello NW.js Team! I'm
mainly developing HTML5 games with Construct 2 + NW.js and I'm really
interested in features that fit into that category. Two important
features that modern video games support in native backgrounds is
setting the framerate (FPS) and V-Sync options on the fly, inside the game itself. While --disable-gpu-vsync and --limit-fps=60 work great and can be hidden inside the manifest file, I would like to give my users/players the choice to set these settings inside the game itself. So my simple questions would be:
Is it possible to manipulate NW.js in order to limit to framerate (FPS) instantly, using JS code or something similar?
Is it possible to manipulate NW.js in order to disable/enable V-Sync instantly, using JS code or something similar?
Cheers!
Roger Wang
unread,
Apr 15, 2018, 10:05:26 PM4/15/18
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to nw.js
It would depends on how the switch is used in Chrome. IMO they are only effective when the browser is started. So you might want to modify package.json in your app and prompt user to restart your app.
dannyy...@googlemail.com
unread,
Apr 16, 2018, 10:30:19 AM4/16/18
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to nw.js
Sounds good, thanks!
I'm a beginner with JS, do you know an API or something else in order to easily modify the chromium arg's property inside the manifest file? Also is there a "Complete Reload" feature that can automatically close and re-open NWjs instead of the user doing it manually?
Russell Valentine
unread,
Apr 18, 2018, 11:32:31 AM4/18/18
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to nw.js
package.json is just a json file you can read the file in as a string then do JSONIFY.parse(package_json_str); modify it then stringify it and save it again.