Search Unity

Any way to pass a tooltip between scripts?

Discussion in 'Immediate Mode GUI (IMGUI)' started by bigkahuna, Nov 21, 2007.

  1. bigkahuna

    bigkahuna

    Joined:
    Apr 30, 2006
    Posts:
    5,434
    I've created a separate script to display a banner that always stays on top of my other GUI elements. How can I display a tool tip in my "banner" script when the mouse passes my "other window" script?
     
  2. kattkieru

    kattkieru

    Joined:
    Jan 2, 2006
    Posts:
    130
    You could give the "other window" script a pointer to the "banner" game object. Then, when the mouse moves over the "other window," it'd get the banner object's "banner" class and either call a public method or set a property.

    This is how I've been doing stuff in my own tests. It's pretty great -- I just drop one object into another's property list and go. The down side is that there's some jitter with GUI movement that I haven't sorted out -- in my space shooter, the ship rotates fluidly but its targeting reticles shake.