Version: 2017.2

GUIContentConstructor

Cambiar al Manual
public GUIContent ();

Descripción

Constructor para el GUIContent en todas las formas y tamaños.

Construye un GUIContent vacío.


public GUIContent (string text);

Descripción

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;
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")); } }

public GUIContent (Texture image);

Descripción

Construye un objeto GUIContent que contiene una sola imagen.

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)); } }

public GUIContent (string text, Texture image);

Descripción

Construye un objeto GUIContent que contiene ambos text y una imagen.

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)); } }

public GUIContent (string text, string tooltip);

Descripción

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;
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); } }

public GUIContent (Texture image, string tooltip);

Descripción

Construye un GUIContent que contenga una imagen. Cuando el usuario pasa el mouse sobre él, la interfaz global GUI.tooltip se define en tooltip.


public GUIContent (string text, Texture image, string tooltip);

Descripción

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.


public GUIContent (GUIContent src);

Descripción

Construye un GUIContent como una copia de otro GUIContent.