- Home /
create a box that player can type in it
Hi How i can create a box with a button that player can type in box and if player click on the button all of text send in unity as a variable ? sorry for my english
Answer by Thom Denick · Sep 01, 2010 at 06:33 PM
Hi,
What you want to use is the built-in GUI Object GUI.TextArea
http://unity3d.com/support/documentation/ScriptReference/GUI.TextArea.html
Details on how to implement this are at the link. Basically TextArea has a string association called "text." You can have a GUI.Button that "submits" this text to wherever you like through code. So something like:
void submitText() {
string submittedText = myTextArea.text;
}
EZGUI, a commercial product, also has some nice low-draw-call text area functionality:
Your answer
Follow this Question
Related Questions
create a box that player can type in it ( only type numbers ) 1 Answer
button with content in multiple colors 3 Answers
Open gui if player clicks on button 2 Answers
Help with GUILayout and tooltip(C#) 1 Answer
GUI.Style is messing up big time 0 Answers