- Home /
GUI.TextField
Hello,
I am using a textfield for getting the name of the player.
Pname = GUI.TextField (Rect (300, 350, 400, 50), Pname, 25, myStyle);
However, I have a problem with it. The player can also press enter to go to a new line. This causes a glich in my save system. Is there any way disable the enter, and the new line?
Thanks!
Comment
Best Answer
Answer by Waz · Aug 30, 2011 at 10:58 AM
That's odd. TextField shouldn't allow newlines, only TextArea.
You could remove them from Pname with String.Replace:
Pname = Pname.Replace("\n"," ");