GUIContent.tooltip 工具提示

var tooltip : string

Description描述

The tooltip of this element.

该元素的工具提示。

The tooltip associated with this content. Read GUItooltip to get the tooltip of the gui element the user is currently over.

此内容相关的工具提示。读取界面工具提示获得用户当前经过的界面元素的tooltip。

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	void OnGUI() {
		GUI.Button(new Rect(0, 0, 100, 20), new GUIContent("A Button", "This is the tooltip"));
		GUI.Label(new Rect(0, 40, 100, 40), GUI.tooltip);
	}
}
function OnGUI () {
	GUI.Button (Rect (0, 0, 100, 20), GUIContent ("A Button", "This is the tooltip"));
	// If the user hovers the mouse over the button, the global tooltip gets set
	//如果用户鼠标经过按钮,将获得全局的工具提示
	GUI.Label (Rect (0, 40, 100, 40), GUI.tooltip);
}
Page last updated: 2011-1-2