- Home /
Whats a good technique to create an in-game screen or display for text output?
A good reference for what I want to achieve here is the "Screen" objects that come with the Wiremod in Garry's Mod. They display a line of text and a value. The object is viewed in 3D as if it were a monitor or screen in the real world, and as far as I know it doesn't use a render texture.
I want to be able to show a screen with 2 lines of text, containing:
A label
A value
Does anyone have some information or references on how I can achieve this? The scene would contain many of these, spawned as new resource tanks as spawned.
This is for use with a space game I am making with a friend, where we need to show status panels for resource tanks, showing amount of oxygen in a tank, etc.
A tooltip style popup could also be another solution, Example:
Answer by Owen-Reynolds · Feb 19, 2013 at 02:52 PM
For anything that looks like it's "in the world" (can be tilted, uses perspective,) use a Text3D. I've had the best luck using a large-sized font, then scaling down as needed using characterSize (otherwise they can pixelate some.) They normally "show through" everything, but you can look up here how to change the shader so they act normally.
For anything that behaves like a GUI element, use a GUIText. In code, \n
will make a new line. For the speech bubble, stick a GUITexture behind it (use Z for "behind.") Use Camera.worldToViewPort to position them. Alternately, some people use OnGUI.Label to make them (no gameObject to spawn -- all in code. Otherwise similar.)
The trick with the tablet showing "ng Tool," that probably requires a renderTeture (no easy way for Text3D or GUITexture to show 1/2 a leter.)