- Home /
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.
Answer by TomHunt · Mar 27, 2012 at 07:23 AM
function OnGUI(){
GUI.Label(Rect(0,0,Screen.width,Screen.height),"Here is a block of text\nlalalala\nanother line\nI could do this all day!");
}
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.
Your answer
Follow this Question
Related Questions
How do I make my player in unity print text. 2 Answers
Text Appears in Inspector but Not on Screen 0 Answers
I am trying to print text in unity using this command 'using function OnGui () {' 1 Answer
Any fade-in/fade-out animations for GUI Text? 3 Answers
how can I print to text the number of an int as well as the name of the int. 1 Answer