Hi everybody,
is there a way to open an iframe with html inside into the unity web player when I make some kind of actions? if not, is it possible to put HTML in some way into unity web player?
Thanks for any help.
K.
Hi everybody,
is there a way to open an iframe with html inside into the unity web player when I make some kind of actions? if not, is it possible to put HTML in some way into unity web player?
Thanks for any help.
K.
There’s a plugin that renders html (as well as flash quicktime content) into a texture:
Yeah and note that it is mac-only
Hi,
thanks a lot for your answer. Unfortuantely, this seems to be restricted to Unity pro versions and standalones programs… I wan’t to build a web-based version. Any idea ?
K.
Ooooohhhh, yeah… the web and Unity don’t get along. Despite the prevalence of the internet and html (and internet html plugins, how ironic), Unity cannot render html content. However, there are several hacks/workarounds, which depend on your situation.
The webkit plugin was created to do just this. In this case, it’s already been ruled out, since webplayers can’t use plugins. (Plugins are unmanaged, thus bypassing the webplayer’s security, and generally doing bad things )
A variant on the plugin is to find/make an HTML renderer written in a Unity compatiable language, such as C#. I remember seeing a C# html renderer a while back, but I don’t remember where. However, it would need some tinkering to make it work with Unity, and all plugins are unusable since there’s no way to access them from the web-player. The same goes for javascript unless an interpreter is included. It would be reasonably simple to embed unityscript, then eval() it, but remember that blindly executing arbitrary code is a huge security risk.
Also, consider whether or not an html renderer is even needed for your project. You could use an xml file to generate a native Unity interface, for example, which would be far simpler than trying to get a full-blown html renderer working. As another fallback, a plain image could be used, possibly given some interactivity by checking if the user clicked within a certain spot.
As another idea, it’s possible to have the player interface with in-page javascript. You could just build the needed components into the page and then call them from the webplayer, and vice-versa. Some people have, in fact, done just that for various reasons.
I suppose all I proved is that “there is more than one way to render a page”. There might be (yet) another way to get the job done, or even a better interface design that doesn’t even run into this problem. But I’ll leave that as an exercise for the reader.
Anyway, hope it helps.
If you have your own windows webserver then isnt this possible by saving a page as an image and loading the image as a texture into Unity?
e.g.
http://subesh.com.np/2008/06/how-to-generate-thumbnail-of-html-pages/
Geoff
EDIT: Noticed this has already been suggested, sorry.
Hi Guys!
Thakns a lot for your answers. Finally, we implemented the solution using an image. It is simple and quite flexible for our needs.
Thanks again for your help.
K.