Drawing text directly onto the screen
Hi, I would like to draw some text onto the screen.
I know this is not a best practice, and that text should have a fixed location in the world, instead of moving with the user's head. However, the text I'd like to draw is along the lines of "Get comfortable in your chair and press any button to recenter the screen," and given that the Rift may be in any orientation when a demo is started, it seems like a good practice to fix this to the user's screen.
This seems like it should be fairly simple to implement; I've had success with drawing quads, positioning text in the world, and changing the color of objects. However when I try using OVRGUI.StereoBox(), nothing appears. Another comment on this forum from an Oculus employee references a method called DrawStereoBox but this method results in a compile time error. I copied this snippet of code from a class I found in a Github search.
I expect that this will make the words "Loading" appear on screen in front of the user. Instead nothing appears. The debugging information makes it clear that this text is executing.
What am I missing?
I am new to Unity as well as the SDK so if you need to point me to go learn about textures or some other element, please let me know.
I know this is not a best practice, and that text should have a fixed location in the world, instead of moving with the user's head. However, the text I'd like to draw is along the lines of "Get comfortable in your chair and press any button to recenter the screen," and given that the Rift may be in any orientation when a demo is started, it seems like a good practice to fix this to the user's screen.
This seems like it should be fairly simple to implement; I've had success with drawing quads, positioning text in the world, and changing the color of objects. However when I try using OVRGUI.StereoBox(), nothing appears. Another comment on this forum from an Oculus employee references a method called DrawStereoBox but this method results in a compile time error. I copied this snippet of code from a class I found in a Github search.
// using Oculus 0.4.2 SDK
public class TargetScript : MonoBehaviour {
void OnGUI() {
Debug.Log("Drawing Recenter dialog.");
string loading = "LOADING...";
OVRGUI guiHelper = new OVRGUI();
guiHelper.StereoBox(300, 300, 300, 300, ref loading, Color.white);
Debug.Log("Stereo Box should be visible.");
Debug.Log (guiHelper);
}
}
I expect that this will make the words "Loading" appear on screen in front of the user. Instead nothing appears. The debugging information makes it clear that this text is executing.
What am I missing?
I am new to Unity as well as the SDK so if you need to point me to go learn about textures or some other element, please let me know.
