Forum

You need to log in to create posts and topics.

Having Multiple Web Views on Textures

Hi, so I edited the script around a little bit and added functionality to parse a string of html into a texture using the "OnAUnityUI" scene as base, I was able to do that, but now I want to Run multiple such screens (5 Total), do you think this would be possible to achieve ?

 

In the screenshot:

Two Separate HTML documents attached to two different HTML UI Panel Scripts with two different raw images trying to render the HTML

In the screenshot is the image of the result for that, can anyone tell me how I can fix this

 

 

Hey there!

Sure - these are built in and are called "Flat world UIs" - essentially a HTML UI on a texture - and you can instance as many as you want. There's an example scene that uses one on a cube and the Unity UI embedding system is built on top of them too 🙂

This is what I'm getting, it seems like its adding HTML to the already loaded HTML file

View post on imgur.com

 

please note I'm using it on a Unity UI, on a Raw Image

Ah ok so you're seeing content from some other UI in there? Hmm - are you resizing them? Internally a FlatWorldUI makes a regular WorldUI and puts it in the gameworld with a camera on it which does the rendering - this lets them display meshes/ custom shading/ particle effects etc -  you could try custom positioning the gameObject so they're out of the way but not close enough to each other to overlap:

// FlatWorldUI ui = new FlatWorldUI(200, 200);

// ui.document.innerHTML = "Suppose ..";

ui.gameObject.transform.position = new Vector3(500, -200, 500);

// use ui.texture somewhere

Okay got that, but is there a way to avoid this altogether ?

You could edit the default positioning which is at line 137 of PowerUI/Source/Engine/FlatWorldUI.cs and make the offset value bigger (so there's more space between each UI it generates):

gameObject.transform.position=new Vector3(0f,(GlobalOffset * 20f) - 300f,GlobalOffset * zSpace * 2f);GlobalOffset++

Worked Beautifully, Thanks a lot Luke

Thanks for the great article and information. I agree with all the points you made. Thanks http://www.howtoupdatedrivers.net

You can share your script here and all of the friends are the view and if they can find any mistake or changes then tell you. My friend is edubirdie safe working script and they can share with friends or easily complete find the mistakes.

Want the latest updates? Check out the repositories.