HTML in Unity3D or how to cross a hedgehog with a snake

Sometimes game developers face non-trivial tasks. Such a task may be, for example, the need to show the user a regular web page on the unity3d game engine, which undoubtedly boasts many integrated technologies, but HTML is not included in this list. I must say right away that there is no “Silver Bullet” ... or not yet. It depends on the degree of your optimism.

First of all, you need to decide on the goals for which you need HTML: typography using basic tags, creating a user interface using HTML, creating a help section (for example, an in-game encyclopedia), displaying a static web page, or even integrating a full web browser. Accordingly, plugins or HTML engines are divided by the number of supported tags, animation support, implementation technologies (OnGUI or textures), GUI integration (OnGUI or NGUI), support for CSS, HTML5, JavaScript, image processing technology, etc.

In fact, the choice of HTML plugins is rather poor. I found only 5 representatives.

Let's start our acquaintance with perhaps the most unpretentious option:

1. HTML Engine for NGUI & Unity GUI for $ 25


Screenshots on the cut:








The screenshots above show the functionality of the plugin, which supports various styles and text effects. However, no CSS, JS, HTML5 or access to web pages.
Pros:
  • Perhaps the only plug-in compatible not only with the standard OnGUI, but also with NGUI, and with fairly new versions.

Minuses:
  • No demo.
  • To work with images, you must first compose them in an atlas and indicate the path to this atlas when inserting an image.
  • Due to the principle of HTML generation, the volume of the displayed page is significantly limited, so taking a regular web page, putting it into the project and showing it will not work.
  • The installation is not entirely obvious (you have to torment yourself to understand why so many errors get out during the installation).


2. PowerUI - HTML / CSS for $ 60


Screenshots on the cut:










Developers site .
Good plugin. In addition to supporting many tags and CSS, it is also well optimized.
Easily integrates simple html pages into a project.
It is enough to complete simple preparatory actions:
1. Add a new layer with the name: PowerUI.
2. Make sure that the rest of the cameras do not see this layer.
3. Create a new object and add the Powerui Manager script to it.
4. Configure images (all pictures should be stored in the Resources folder, their properties should be Advanced, change “Non Power of 2” to none, put a dummy in front of read / write enabled, and remove the daw with generate mipmaps)
image

Now just assign your web page to the public field of the created object.

Pros:
  • Demo - not compiled for iOS, so the freebie will not work
  • Support for CSS, JavaScript.
  • The ability to display not only in OnGUI, but also in texture.
  • Good optimization, minimum DC.
  • Lots of examples.

Minuses:
  • The trial version does not compile under poppies.


3. $ 30 GUI Design HTML CSS


Screenshots on the cut:





Good plugin for GUI design.
Short demo:

Pros:

Minuses:
  • No demo.

4. HuG: Hugging HTML on Unity for $ 45


Screenshots on the cut:








A good plugin, but with its drawbacks. Developers site .
Pros:
  • Demo version .
  • Support for CSS, JavaScript.
  • Playing music over the network.
  • The ability to display both local and web pages.

Minuses:
  • JavaScript support is rather conditional.
  • Далеко не каждая интернет страница может адекватно отобразиться.
  • Проблемы с кросс-платформенностью, то что хорошо работает под Windows в IOS может сильно глючить, впрочем возможно в платной версии это излечимо.

5. U3DXT iOS SDK Pro за 100$


Скрины по катом:
Т.к. этот плагин очень многофункционален, то прилагаю только один скрин сделанный в собственном приложении, демонстрирующий качество веба. Голубая полоска вверху — это часть NGUI интерфейса, а ниже расположен viewport браузера.

If all the previous plugins tried to implement the HTML interpreter using the Unity3D technologies, then these developers took the path of providing full access to the iOS SDK. Those. instead of inventing a bicycle, they simply give access to what developers from Cupertino have already written. Thanks to this, unity can easily access any website.
And access to a web browser here is just one of the features. In addition, there is access to inn-ups, a social plug-in, face recognition, a speech synthesizer and much more. In general, this SDK is worthy of a separate article, and is able to supplant, for example, Prime31.
This solution, of course, has a flip side, namely the applicability only to iOS builds.
Pros:
  • Demo version
  • Full support for all web technologies available for iOS.
  • Great functionality.

Minuses:
  • Applicable only for iOS.
  • Glitches with resolution (the program considers that ios gadgets have only two resolutions 320 by 480 and 768 by 1024)


The review, of course, is quite superficial, but I hope it will be useful to developers who are faced with a similar task for the first time. Now you will understand where to dig.

Also popular now: