x


How to show GUI information for certain times?

I'd like to using GUI.Label to display information on the screen and then let it disappear after 2 seconds. How can I do that? Thanks a lot.

more ▼

asked Feb 08 '11 at 10:05 AM

btiger gravatar image

btiger
40 4 4 8

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

1 answer: sort voted first

you can do something like this:

var flag : boolean = false;

function OnGUI(){

   if (flag)
     GUILayout.Label("label");
   if (GUILayout.Button("label"))
     EnableGUI();
}


function EnableGUI(){
   flag = true;
   yield WaitForSeconds(2);
   flag = false;

}

I didn't test that, but it should work.

more ▼

answered Feb 08 '11 at 10:40 AM

AliAzin gravatar image

AliAzin
2.5k 42 56 79

Thanks, AliAzin, it works.

Feb 08 '11 at 02:55 PM btiger
(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:

x3695
x573
x145

asked: Feb 08 '11 at 10:05 AM

Seen: 1102 times

Last Updated: Feb 08 '11 at 10:05 AM