How to use NW.js as GUI for game engine

940 views
Skip to first unread message

amerk...@gmail.com

unread,
Oct 7, 2015, 8:48:51 AM10/7/15
to nw.js
Hi guys,
I have game engine written in C++, it supports DirectX11/12, OpenGL and GLES rendering, physics etc.
I would like to use NW.js for UI and have a rendering native panel with my engine, similar to embeding in QT editor or C#.

Is possible to achieve this?
Thanks in advance,

Amer

VoidVolker

unread,
Oct 7, 2015, 1:42:20 PM10/7/15
to nw.js, amerk...@gmail.com
Yes. You have at last 3 ways:
1. Simplest way is convert you game to node module or to browser plugin (NPAPI or/and PPAPI).
2. It is not best solution, but it possible to run nwjs in hidden window and render there your gui, then via sockets (or via process memory OS API) send rendered picture into the game process and there render it over game image.
3. Integrate nwjs into the game or integrate game into nwjs.

Chris Turnbull

unread,
Oct 7, 2015, 6:30:57 PM10/7/15
to nw.js, amerk...@gmail.com
I've been looking into trying to make a game with NW.js. Other people have done it before, e.g. Game Dev Tycoon pulled it off and got on Steam.

You don't need the C++ game engine if you don't want it - there are several libraries written in JavaScript that you could use. Here are a few things you might want to look into:
  • THREE.js provides a 3D graphics library
  • If you want to get on Steam, you'll probably need to use Greenworks
  • If you want to make a 2D or a third-person game you'll probably want to support gamepads. You can use this library to help.
  • If you want to make a first-person game then you'll probably need to look into pointer locking to capture the mouse.

I don't mean to put you off... but you might want to consider if NW.js is right for you. To the best of my knowledge, NW.js for PC and Macs only - there are no console ports. If you went with something like Unity instead you'd have the benefit of being about to target the Xbox One, Playstation 4 and PS Vita as well.
Reply all
Reply to author
Forward
0 new messages