x


GUI.Depth text input/button issues

Hey,

I'm trying to use two separate classes with OnGUI at different depths to try and create a "notice box" that appears when certain things are called in the main script.

The second script is added to a separate gameobject instanced from the first script. The first script has a depth of 1 and the second a depth of 0.

However, the text inputs and button on the first GUI are still able to be edited/clocked respectively despite having another GUI on top of it.

Any help would be appreciated.

Thanks!

more ▼

asked Jun 24 '12 at 04:52 PM

Crashdoom gravatar image

Crashdoom
15 1 2 3

Still having the same issue...

Jul 09 '12 at 01:04 AM Crashdoom
(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

Inside the if block with your GUI.Button() or whatever was clicked, Use() the event up: http://unity3d.com/support/documentation/ScriptReference/Event.Use.html

if (GUI.Button(new Rect(buttonL, buttonT, buttonW, buttonH), "Fire'")) {
    // use up this event, so it will be marked used for the next button
    Event.current.Use();
    // ... do something with the event
}
more ▼

answered Jun 25 '12 at 12:37 AM

UEUNO gravatar image

UEUNO
16 1

Hey, that hasn't seemed to work, the box on top of the other elements are still clickable... It's kind of annoying since sometimes it causes the elements to double up.

Jun 25 '12 at 01:03 AM Crashdoom
(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:

x3815
x981
x820
x79

asked: Jun 24 '12 at 04:52 PM

Seen: 542 times

Last Updated: Jul 09 '12 at 01:04 AM