- Home /
Using OnGUI to change text in 3D text object.
I have a GUI set up with textfields and want to be able to get the text from there and set the 3D text as what is entered. What is the simplest way to accomplish this? I am using c#.
Comment
Best Answer
Answer by Graham-Dunnett · Oct 18, 2014 at 04:27 PM
public string stringToEdit = "Hello World";
public TextMesh textmesh;
void OnGUI() {
stringToEdit = GUI.TextField(new Rect(10, 10, 200, 20), stringToEdit, 25);
textmesh.text = stringToEdit;
}
Thank you I wasn't using the correct string variable in the text-field arguments.
Your answer
Follow this Question
Related Questions
Distribute terrain in zones 3 Answers
Multiple Cars not working 1 Answer
How to dynamically change the text in Unity(Augmented Reality + NYARtoolkit(C#)) ? 0 Answers
Trying to Highlight text in order to copy and paste, but do not want the text to be editable. 1 Answer
Can EditorWindows dynamically display interfaces of other Editor Windows ? 1 Answer