- Home /
Question by
Rivanu · Jan 31, 2015 at 04:34 PM ·
cameraguiguitextureviewstereoscopic
How to draw a Gui.Layer to a especific camera.
I follow this tutorial http://paulbourke.net/stereographics/Unitystereo/ that use tow cameras with render textures to make the stereotopic view. I wonder how to draw a text that appears in the two cameras, because with my script attacht to the fist person controler, the text appears right in the middle of both screens.
Part of my script:
function OnGUI (){
if (Input.GetKey(KeyCode.I))
{
if (nearObjet)
{
showObjectMessage = true;
PopUpMessage = false;
}
if(PopUpMessage)
{
GUI.BeginGroup (Rect (Screen.width / 2 - 150, Screen.height / 2 - -200, 300, 80), (background));
GUI.Box (Rect (0,5,280,50), "Press E for more information", miStyle );
GUI.EndGroup ();
}
if(showObjetMessage){
Time.timeScale = 0;
GUI.BeginGroup (Rect (Screen.width / 2 - 375, Screen.height / 2 - 200, 700, 400), (Background));
GUI.Label (Rect (5, 5, ObjectTexture.width, ObjectTexture.height), ObjectTexture);
scrollPosition = GUI.BeginScrollView(new Rect(0, 5, 700, 325), scrollPosition, new Rect(0, 0, 400, 550));
GUI.Label (Rect (260, 15, 420, 600), " Text", miStyle2 );
GUI.EndScrollView();
GUI.Label (Rect (35, 300, 250, 100), "Press X for exit", miStyle );
GUI.EndGroup ();
}
Comment