Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have recently heard about the Chromium Embedded Framework and was over-joyed as I want to use html as my GUI source.

I did find a C# version but it seems to be for Windows Forms.

I'm not too terribly well versed but I was under the impression that it may cause it to be unavailable for cross-platform use.

Can anyone provide and insights? And if this will not work, any free alternatives?

share|improve this question
    
What are you trying to do? Are you making a game? – PatrickSharbaugh Nov 23 '15 at 21:48
    
Trying to get a method of making complex UI for my games easier. – Cody Beaner Nov 23 '15 at 22:46

The .NET version of Chromium Embedded Framework (CEFSharp) does have a version for offscreen rendering, however you need to handle converting the rendered screen into another image format to use with your framework of choice (in this case Unity). There also does seem to be a recent discussion about integrating it into Unity.

As for alternatives, there is Awesomium, however I don't recommend it as it is still running on Chromium 18 (with no plans to update in sight, apparently they are really busy improving the API for the next big version), virtually no CSS3 support and the engine takes a good few seconds to start up in a parallel thread, meaning the actual screen will be blank until it finishes its start up. However it does have good JS bindings compared to CEFSharp (you bind individual methods instead of entire classes), and it has a much more user friendly API, which means its easier to pass mouse and key events compared to CEFSharp.

CEFSharp, on the other hand is a lot rougher around the edges in regards to its API, but a lot faster on startup and is fairly up to date (it was running Chromium 43 or 44 when I tried it out a month ago). You'll also need to pass mouse and key events to the browser instance as well, but you'll need to do some digging to find the correct handlers, as they are buried rather deep in parent objects (took me 2 days to find the correct functions).
Only issues I had with it was that it took a while to shut down and the API wasn't as user friendly as Awesomium, which made it a bit awkward to work with, and its JS binding didn't seem to like existing class instances to bind to.

Coherent UI is probably the best option around, and is supposed to have Unity bindings, but is rather expensive. Googling reveals that the Unity Asset Store has a few cheaper options available.

If you don't want to use any of those, it is probably possible to implement the offscreen versions of CEFSharp or Awesomium into your Unity game. I don't know how difficult it would be, but provided you could get mouse/keyboard input and render a 2D texture over the entire screen, it is probably doable. I integrated both of them into XNA/MonoGame, and I still have the code referencing the functions to be called to pass input/get the rendered screen to a texture lying around somewhere if you want to try and implement it.

share|improve this answer

There was a project, Awesomium for Unity, but I don't know in what state it is right now, but what I've got after a few google lookups it got quite stagnant if not completely on hold. But there is an alternative, here: Coherent-UI. You should check that up. But, if you want to use CEF, then be prepared to do some "low level bit pushy trickery", but I'd vouch against that. That Coherent-UI might be the perfect fit for you.

share|improve this answer
    
also there is a documentation, how to create plugins for Unity here docs.unity3d.com/Manual/Plugins.html, so you can create a managed plugin with CEF, but I've tried to compile CEF for one of my projects, it was quite hard to compile with cefsharp, which was the .net implementation of CEF, also it took nearly-literally ages to compile – Citrus Nov 23 '15 at 22:31

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.