- Home /
Unity Editor Textfield appearing in the center
Hi, I'm making a custom editor window and when generating a new textfield and then expanding the height, the text appears in the center of the textbox instead of the top left corner. How do I make the text start at the top left corner of the textbox after resizing?
I'm basically just doing
var textbox = new TextField { style = { height = 200} };
and then adding it to the root visual element. image of what i mean below. Text in the middle of the box is not intended
Answer by Namey5 · Oct 10, 2020 at 11:09 PM
It would probably be better to use TextArea rather than TextField in this case;
https://docs.unity3d.com/ScriptReference/EditorGUILayout.TextArea.html
TextField only lets you write a single line, so it makes sense that the text would auto-centre vertically.
Your answer
![](https://koobas.hobune.stream/wayback/20220613013519im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
iOS Keyboard makes performance suffer 3 Answers
GUI.TextField 1 Answer
Cannot type in textfield in Chrome on Mac 0 Answers
Check if string contains letters 1 Answer