Constructor para el GUIContent en todas las formas y tamaños.
Construye un GUIContent vacío.
Construye un objeto GUIContent que contiene solo texto.
Cuando utilice el GUI, usted no necesita crear GUIContents para strings de textos simples - estas dos lineas de código son equivalentes funcionalmente:
using UnityEngine;
public class ExampleScript : 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")); } }
Construye un objeto GUIContent que contiene una sola imagen.
using UnityEngine;
public class ExampleScript : MonoBehaviour { public Texture icon; void OnGUI() { GUI.Button(new Rect(0, 30, 100, 20), new GUIContent(icon)); } }
Construye un objeto GUIContent que contiene ambos text y una imagen.
using UnityEngine;
public class ExampleScript : MonoBehaviour { public Texture icon; void OnGUI() { GUI.Button(new Rect(0, 30, 100, 20), new GUIContent("Click me", icon)); } }
Construye un GUIContent que contiene algo de text. Cuando el usuario pasa el mouse sobre él, la interfaz global GUI.tooltip se define a el tooltip.
using UnityEngine;
public class ExampleScript : MonoBehaviour { void OnGUI() { GUI.Button(new Rect(0, 0, 100, 20), new GUIContent("Click me", "This is the tooltip"));
// If the user hovers the mouse over the button, the global tooltip gets set GUI.Label(new Rect(0, 40, 100, 40), GUI.tooltip); } }
Construye un GUIContent que contenga una imagen. Cuando el usuario pasa el mouse sobre él, la interfaz global GUI.tooltip se define en tooltip.
Construye un GUIContent que contenga ambos text, una image y tiene un tooltip definido. Cuando el usuario pasa el mouse sobre él, la interfaz global GUI.tooltip se establece en tooltip.
Construye un GUIContent como una copia de otro GUIContent.