言語: 日本語
  • C#
  • JS
  • Boo

スクリプト言語

お好みのスクリプト言語を選択すると、サンプルコードがその言語で表示されます。

GUIContent.GUIContent

public function GUIContent()

Description

GUIContentのコンストラクタ

空の GUIContent を作成します。

public function GUIContent(text: string)

Description

テキストのみ含む GUIContent を作成します。

GUI を使用するときに、シンプルなテキストの場合は GUIContent を作成する必要はありません - 以下の二つのコードは機能的に同じものです:

	function OnGUI () {
		GUI.Button (Rect (0, 0, 100, 20), "Click Me");
		GUI.Button (Rect (0, 30, 100, 20), GUIContent ("Click Me"));
	}
public function GUIContent(image: Texture)

Description

画像のみ含む GUIContent を作成します。

	var icon : Texture;

	function OnGUI () {
		GUI.Button (Rect (0, 0, 100, 20), GUIContent (icon));
	}
public function GUIContent(text: string, image: Texture)

Description

/text/ と画像の両方を含む GUIContent を作成します。

	var icon : Texture;

	function OnGUI () {
		GUI.Button (Rect (0,0,100,20), GUIContent ("Click me", icon));
	}
public function GUIContent(text: string, tooltip: string)

Description

/text/ を含む GUIContent を作成します。ユーザがGUIの上にマウスを乗せると、グローバルの GUI.tooltiptooltip がセットされます。

	function OnGUI () {
		GUI.Button (Rect (0, 0, 100, 20), GUIContent ("Click me", "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);
	}
public function GUIContent(image: Texture, tooltip: string)

Description

/image/ を含む GUIContent を作成します。ユーザがGUIの上にマウスを乗せると、グローバルの GUI.tooltiptooltip がセットされます。

public function GUIContent(text: string, image: Texture, tooltip: string)

Description

image および image の両方を含み、 tooltip が定義された GUIContent を作成します。ユーザがGUIの上にマウスを乗せると、グローバルの GUI.tooltiptooltip がセットされます。

public function GUIContent(src: GUIContent)

Description

他のGUIContentをコピーして作成します。