x


Cannot edit text in textarea

Hello. I am a bit puzzled about how to edit a string in a textarea from inside a game.

string stringToEdit = "enter text...";

void OnGUI()
{        
    if(tKeyPressed)
    {
        GUI.TextArea(new Rect (120, 10, 200, 100), stringToEdit, 160);
    }
}

I can see the textarea, can click into it and move the curser in the text but I cannot edit the text. What did I forget?

more ▼

asked Jun 10 '10 at 10:12 AM

aszel gravatar image

aszel
5 2 2 5

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

1 answer: sort voted first

Try stringToEdit = GUI.TextArea(new Rect(120, 10, 200, 100), stringToEdit, 160);

more ▼

answered Jun 10 '10 at 10:18 AM

newbrand gravatar image

newbrand
159 1 1 10

(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:

x5059
x55

asked: Jun 10 '10 at 10:12 AM

Seen: 1632 times

Last Updated: Jun 10 '10 at 10:12 AM