Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

GUI.tooltip weird actions

Discussion in 'Immediate Mode GUI (IMGUI)' started by swiatloplis, Nov 6, 2014.

  1. swiatloplis

    swiatloplis

    Joined:
    Nov 6, 2014
    Posts:
    1
    Hello! If i hover cursor over GUIContent then shows button "+" but code inside button doesn't work :\. Without if(GUI.tooltip == "1") code is fine.

    Code (JavaScript):
    1. GUI.Label(Rect(700, 200, 140, 20), GUIContent(
    2.             "test1: " + space + Static.globalTest1[qwqw], "1"));
    3.  
    4.             if(GUI.tooltip == "1")
    5.                 if(GUI.Button(Rect(800, 205, 50, 50), "+"))
    6.                 {
    7.                     level.addExp(qwqw, 50);
    8.                     /// ...
    9.                 }
     
    Last edited: Nov 7, 2014