Search Unity

Custom Mouse Cursor in 2.02

Discussion in 'Immediate Mode GUI (IMGUI)' started by Marc, Jan 31, 2008.

  1. Marc

    Marc

    Joined:
    Oct 4, 2007
    Posts:
    499
    Greetings.

    I am using the Custom 2D Cursor script from the wiki, to create a custom curser. This works great. However when there is GUI in place on the screen using the new gui system. The Custom cursor is behind this gui is there a way to always make sure the custom cursor (GUITexture) is on top of everything else?

    Regards,
    Marc
     
  2. Marc

    Marc

    Joined:
    Oct 4, 2007
    Posts:
    499
    Heh just found a similar threat with a clear answer to my question. So much for searching first :D

    Answers: Can't be done currently.
    See (http://forum.unity3d.com/viewtopic.php?t=7675&highlight=guitexture+order)

    This however brings up a new question.

    Before i used the wiki script to create a cursor i was using the new gui system. Which was great, but with the new release of 2.02 the new gui intercepts all clicks and don't forward it to objects beneath which is GOOD.

    This means that i can't simply greate a GUI.Box below the cursor as it will intercept all mouse events, leaving the 3d world with none.

    So my questions is how to do a proper custom cursor in Unity 2.02?
     
  3. NicholasFrancis

    NicholasFrancis

    Joined:
    Apr 8, 2005
    Posts:
    1,587
    Use GUI.DrawTexture - that won't intersept clicks
     
  4. Marc

    Marc

    Joined:
    Oct 4, 2007
    Posts:
    499
    Thanks this GUI system rock!
     
  5. Foxxis

    Foxxis

    Joined:
    Jun 27, 2006
    Posts:
    1,108
    There appears to be a bug in GUI.DrawTexture when used over water, terrain and with glow involved. The image drawn disappears behind the scene, which should be impossible, right? I've had it confirmed on both macs and PCs (on PCs the drawtexture won't appear at all - ever). I can't see something funky in my code (it's very simple) and I've reported it so we'll see what happens.

    To my question - is there any way to have GUI elements NOT intercept clicks? I have to work around the problem, so I have to revert to my old GUI.Box trick. How would I be able to do this?

    Thanks in advance!