Question about using webkit for GUI in games...

Started by
2 comments, last by Chris_F 11 years, 9 months ago
So is this something you have to implement at the engine source level? I always thought a webkit was just a standalone browser with a JS engine. I was looking at using one for an html5 game I was working on hoping to bundle googles v8 engine to maintain a level of performance while also launching the web game in a standalone window.

I saw the game Overgrowth (the game with the jumping/fighting rabbit) was using this webkit framework http://awesomium.com/ inside the engine so they could use css, javascript and html to structure their menu's/GUI system....in game.

Using css/jquery/etc seems like a dream for creating elaborate menu systems, far easier than using Rects(for me, maybe I need to learn a better way). I imagine it has to be slower or something or why wouldn't every engine incorporate it?

Also thinking about web technologies, aren't they efficient? I mean you can surf the web on a really weak phone or an old 486 with windows 3.11. Would it not be good for mobile games?

So I assume there's a reason nobody does it.....can anyone fill me in? Too hard to coordinate with renderer or game window? Too slow? Incompatible???

EDIT::THANKS for the responses guys, that clears it up, I figured I'd edit this instead of bumping the thread. Thanks.
Advertisement
A browser is a very heavy-weight thing to include in a game just for a UI. Of course, depending on your requirements, that may not matter; but for a mobile game for instance, packaging an entire browser into the game where you could have just drawn some natively rendered widgets is a complete waste of resources.

Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]

I think that game is using it simply because its so easy to write up some quick HMTL documents, make a few PNG's and cram a little bit of JS in there and bam, got something that looks like a GUI for a game, set the background colour of the HTML body to be transparent (possible in awesomium) and draw it the same size over your main openGL window or whatever, there you go, won't look any different to a hard coded GUI. A hard coded GUI will always be far more efficient.

On the topic of awesomium though, I have seen some other nice things done with it, it can render to a PNG in real time which can then be used as a surface texture, I've seen a tech demo done with Ogre3d where the crosshair of a first person camera was being mapped as an X,Y co-ordinate on a 2d surface. This 2d surface was just sitting vertically in a hilly terrain, nothing special about the terrain, its just there. The cool part was awesomium behind the scenes was being rendered to a texture for this 2d surface, all backgrounds were overridden to be transparent. Essentially there was a floating google logo and a few text boxes (URL, search etc) and of course the search button. It cast shadows aswell which was pretty awesome.
Awesomium is awesome and all, but a heads up, there is a free alternative. http://berkelium.org/

This topic is closed to new replies.

Advertisement