Forum Discussion
Mickman
12 years agoProtege
WHY !! Gui elements only visible in one eye ??
I have noticed all of my Gui elements only render to one camera. Why & how can I rectify this ?? I'm hoping there's a simple function in the SDK or a tag I can apply that will dupl...
Krisper
12 years agoExplorer
"sinoth" wrote:
I was able to get a RenderTexture to display a GUI.Label component. The general procedure is this:
- Create a RenderTexture (might crank its resolution up to say 1024x1024)
- Create a Material (diffuse) and set its texture to your RenderTexture
- Create an object that will display your UI (a quad works well)
- Assign the material created above to your object
- Attach a script to the object that has something such as:
using UnityEngine;
using System.Collections;
public class draw : MonoBehaviour {
public RenderTexture myTexture;
public GUIStyle style;
void OnGUI()
{
RenderTexture.active = myTexture;
GL.Clear(false, true, new Color(0.0f, 0.0f, 0.0f, 0.0f));
GUI.Box(new Rect(0.0f, 0.0f, 100.0f, 100.0f), "Test!", style);
RenderTexture.active = null;
}
}
In the inspector, drag the RenderTexture you created onto the "myTexture" public variable on the above script. Should see some text!
Thanks for that, I was a bit lost using a RenderTexture, that made it easy, much appreciated.
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 10 months ago
- 1 year ago
- 4 months ago