Search Unity

Detect 2D under mouse and overlapping buttons mouse-overs

Discussion in 'Immediate Mode GUI (IMGUI)' started by Dom, Jan 19, 2008.

  1. Dom

    Dom

    Joined:
    Jul 10, 2007
    Posts:
    91
    Hello there,

    I have multiple GUI scripts spread across multiple GOs. In addition to that I also have a central (3D) picking script.

    I have two questions:

    a) How can I globally detect that a 2D GUI element is under the mouse so I won't do then any raycasting into the 3d scene for picking?

    b) if I draw buttons over each other (overlapping GUI elements) it looks like even though the depth is not the same, each one gets mouse(-over?) events instead of only the top-most GUI layer. If that observation correct, how do you handle that?

    thx
    Dom
     
  2. Dom

    Dom

    Joined:
    Jul 10, 2007
    Posts:
    91