Display a block of text to the screen

I feel a little silly actually asking this but, how do i print a block of text the screen? All it needs to do is sit there and be readable. Ive tried using GUI text in the hierarchy but the entry field doesn’t seem to accept any form of new line command and the block of text will have multiple lines. Any help at all on this would be greatly appreciated.

1 Answer

1

function OnGUI(){
GUI.Label(Rect(0,0,Screen.width,Screen.height),“Here is a block of text
lalalala
another line
I could do this all day!”);
}

a search engine is your friend : http://unity3d.com/support/documentation/Components/GUI%20Scripting%20Guide.html http://unity3d.com/support/documentation/Components/gui-Basics.html http://unity3d.com/support/documentation/ScriptReference/GUI.html

hey is there a way of making this text appear and disappear in a certain space?

var showText = true; var textArea = new Rect(0,0,Screen.width, Screen.height); function OnGUI() { if(showText) { GUI.Label(textArea,"Here is a block of text\nlalalala\nanother line\nI could do this all day!"); } }

hi all, is it possible to do the same thing but it pinned to a face of a cube? I also need to be able to dynamically update the block of text based on live events. Thank you for your help!

Is it possible to show text without using the GUI system? It seems rather clunky to me, especially if you just want to display a simple little text without introducing an entire new system.