Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free.

I've been looking into game ui's recently. My conclusion is that html/css/javascript would be the perfect solution IF it was wrapped up in a nice C++ library that allowed for easy integration into OpenGL/DX type apps for rendering and easy talking between javascript and C++ and/or other scripting languages like lua (since it's used so often in games). Currently I believe there to be a lot of "bloat" in current implementations because of all the security. If html/css/javascript were to be used in desktop apps it wouldn't need all that security I don't think which could probably reduce it's footprint.

Another issue is that some libraries that currently exist (most are not good if you ask me) make your game second class to html. They want your game to be embedded in the html page, where I think from a game developer standpoint it makes more sense to have the webpage sit on top of the existing game and just be transparent to show the game through it but still allow input to make it to the game.

My question is what would the negatives be around this? Given that you could remove some bloat from the current implementation of the html/css/javascript stack specifically so it can be used for desktop games (removing a lot of security stuff that's not needed with this use case). Also, if one was to start to look into this what would you even start with?

The benefits seem numerous to me. The stack is tried and true. Countless free libraries out there for it. Amazing UI control. A skill that transfers to other technical jobs. Non proprietary so you can easily contract this part of the game out to a huge pool of cheaper people. A ton of tooling already exists. Testing the layout doesn't even require the game itself but can be done in a webpage. It really just seems like the best solution that doesn't exist yet.

share|improve this question
2  
If only there were a way to do this, native to HTML5, that didn't require an external library. –  Robert Harvey May 22 at 23:00
    
See that's WebGL and it comes with all the security limitations and bloat compared to desktop games. Desktop/console games just aren't going away anytime soon. WebGL isn't going to replace these desktop/console games in the next 5-10+ years. So this is NOT an option for those games. –  user441521 May 22 at 23:02
    
Games and JavaScript? May I recommend to take a look at Haxe and the entire ecosystem around it? –  JensG May 26 at 21:56

1 Answer 1

A browser rendering stack seems to be a very heavyweight solution just for a UI. One of the main attractions to Unity3d, for instance, is the cross-platform support of mobile platforms. Packing the entire browser stack in a mobile game when you could have just drawn some native widgets is a waste of resources. But if you don't mind the hit to performance, this might be what you want.

If one were to look into implementing a solution such as this, one might first analyze their current competitors in the industry. Awesomeium appears to have already built an HTML UI Engine that may be integrated into your application, though possibly not with the bells and whistles you imagine, and it's only free for non-commercial projects.

Outside of that, one might examine other prepackaged browser integration packages such as Chromium Embedded or WebKit.Net, and depending on ease of implementation and licensing requirements, utilize their code in your solution.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.