x


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!

more ▼

asked Aug 30 '11 at 10:54 AM

Dreeka gravatar image

Dreeka
146 61 68 71

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

That's odd. TextField shouldn't allow newlines, only TextArea.

You could remove them from Pname with String.Replace:

Pname = Pname.Replace("\n"," ");
more ▼

answered Aug 30 '11 at 10:58 AM

Waz gravatar image

Waz
7.1k 26 35 74

This has solved the problem, thanks! :)

Aug 30 '11 at 11:03 AM Dreeka
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x5089
x209
x3

asked: Aug 30 '11 at 10:54 AM

Seen: 1960 times

Last Updated: Aug 30 '11 at 12:21 PM