- Home /
Question by
longer3436 · Mar 29, 2013 at 11:17 AM ·
tooltipguibutton
How to create a GUI button with tooltip and intercept the click event?
Hello everyone, I'm new in Unity3d and have a question.I know how to create a button:
if (!btnTexture) {
Debug.LogError("Please assign a texture on the inspector"); return;
}
This will display log if button clicked. I know how to add tooltip to a butto also:
GUI.Button(new Rect(10, 10, 100, 20), new GUIContent("Click me", "This is the tooltip"));
GUI.Label(new Rect(10, 40, 100, 40), GUI.tooltip);
The question is ,how can I create a GUI button with tooltip and intercept the click event? If use "if" statement,"GUI.Label " have no effect except the button being clicked.
Comment