- Home /
how do you access textarea parameters?
I don't understand how to access the parameters of a gui.textarea. It says there are parameters such as text, position,etc, but if Gui.TextArea returns a string how do you access the parameters?
For example from the docs:
stringToEdit = GUI.TextArea (Rect (10, 10, 200, 100), stringToEdit, 200); //stringToEdit= a string.
so you can't do stringToEdit.position;
http://unity3d.com/support/documentation/ScriptReference/GUI.TextArea.html
My goal is to resize the textarea depending on how many characters the user types in.
Thanks,
Dan
Answer by perchik · Jan 27, 2012 at 09:16 PM
You could have a variable control the width and then set that somewhere else
float textWidth = 200;
stringToEdit = GUI.TextArea(Rect(10,10,textWidth, 100), stringToEdit, 200);
Your answer
![](https://koobas.hobune.stream/wayback/20220613063456im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Resize GUI TextArea with text height 2 Answers
Textarea rezing in height by text 1 Answer
Switching lines on gui text area 1 Answer
Prevent IOS keyboard from showing 0 Answers
Button is unable to grab functions with two parameters? 0 Answers