Suggest a change
Success!
Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.
Close
Sumbission failed
For some reason your suggested change could not be submitted. Please try again in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.
Close
public function GUIContent()
public GUIContent();
public
def GUIContent()
Description
GUIContentのコンストラクタ
public function GUIContent(text:
string)
public GUIContent(string text);
public
def GUIContent(text as 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"));
}
using UnityEngine;
using System.Collections;
public class ExampleClass : MonoBehaviour {
void OnGUI() {
GUI.Button(new Rect(0, 0, 100, 20), "Click Me");
GUI.Button(new Rect(0, 30, 100, 20), new GUIContent("Click Me"));
}
}
import UnityEngine
import System.Collections
public class ExampleClass(MonoBehaviour):
def OnGUI() as void:
GUI.Button(Rect(0, 0, 100, 20), 'Click Me')
GUI.Button(Rect(0, 30, 100, 20), GUIContent('Click Me'))
public function
GUIContent(
image:
Texture)
public
def
GUIContent(
image as
Texture)
Description
画像のみ含む GUIContent を作成します。
var icon : Texture;
function OnGUI () {
GUI.Button (Rect (0, 0, 100, 20), GUIContent (icon));
}
using UnityEngine;
using System.Collections;
public class ExampleClass : MonoBehaviour {
public Texture icon;
void OnGUI() {
GUI.Button(new Rect(0, 0, 100, 20), new GUIContent(icon));
}
}
import UnityEngine
import System.Collections
public class ExampleClass(MonoBehaviour):
public icon as Texture
def OnGUI() as void:
GUI.Button(Rect(0, 0, 100, 20), GUIContent(icon))
public function
GUIContent(
text:
string,
image:
Texture)
public
GUIContent(string
text,
Texture image);
public
def
GUIContent(
text as string,
image as
Texture)
Description
/text/ と画像の両方を含む GUIContent を作成します。
var icon : Texture;
function OnGUI () {
GUI.Button (Rect (0,0,100,20), GUIContent ("Click me", icon));
}
using UnityEngine;
using System.Collections;
public class ExampleClass : MonoBehaviour {
public Texture icon;
void OnGUI() {
GUI.Button(new Rect(0, 0, 100, 20), new GUIContent("Click me", icon));
}
}
import UnityEngine
import System.Collections
public class ExampleClass(MonoBehaviour):
public icon as Texture
def OnGUI() as void:
GUI.Button(Rect(0, 0, 100, 20), GUIContent('Click me', icon))
public function GUIContent(text:
string,
tooltip: string)
public GUIContent(string text,
string tooltip);
public
def GUIContent(text as string,
tooltip as string)
Description
/text/ を含む GUIContent を作成します。ユーザがGUIの上にマウスを乗せると、グローバルの GUI.tooltip に tooltip
がセットされます。
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);
}
using UnityEngine;
using System.Collections;
public class ExampleClass : MonoBehaviour {
void OnGUI() {
GUI.Button(new Rect(0, 0, 100, 20), new GUIContent("Click me", "This is the tooltip"));
GUI.Label(new Rect(0, 40, 100, 40), GUI.tooltip);
}
}
import UnityEngine
import System.Collections
public class ExampleClass(MonoBehaviour):
def OnGUI() as void:
GUI.Button(Rect(0, 0, 100, 20), GUIContent('Click me', 'This is the tooltip'))
GUI.Label(Rect(0, 40, 100, 40), GUI.tooltip)
public function
GUIContent(
image:
Texture,
tooltip: string)
public
GUIContent(
Texture image,
string
tooltip);
public
def
GUIContent(
image as
Texture,
tooltip as string)
Description
/image/ を含む GUIContent を作成します。ユーザがGUIの上にマウスを乗せると、グローバルの GUI.tooltip に tooltip
がセットされます。
public function
GUIContent(
text:
string,
image:
Texture,
tooltip: string)
public
GUIContent(string
text,
Texture image,
string
tooltip);
public
def
GUIContent(
text as string,
image as
Texture,
tooltip as string)
Description
image
および image
の両方を含み、 tooltip
が定義された GUIContent を作成します。ユーザがGUIの上にマウスを乗せると、グローバルの GUI.tooltip に tooltip
がセットされます。
Description
他のGUIContentをコピーして作成します。