Legacy Documentation: Version 2018.1 (Go to current version)
LanguageEnglish
  • C#
  • JS

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

GUIContent Constructor

public GUIContent();

Description

Constructor for GUIContent in all shapes and sizes.

Build an empty GUIContent.


public GUIContent(string text);

Description

Build a GUIContent object containing only text.

When using the GUI, you don't need to create GUIContents for simple text strings - these two lines of code are functionally equivalent:

no example available in C#

public GUIContent(Texture image);

Description

Build a GUIContent object containing only an image.

no example available in C#

public GUIContent(string text, Texture image);

Description

Build a GUIContent object containing both text and an image.

no example available in C#

public GUIContent(string text, string tooltip);

Description

Build a GUIContent containing some text. When the user hovers the mouse over it, the global GUI.tooltip is set to the tooltip.

no example available in C#

public GUIContent(Texture image, string tooltip);

Description

Build a GUIContent containing an image. When the user hovers the mouse over it, the global GUI.tooltip is set to the tooltip.


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

Description

Build a GUIContent that contains both text, an image and has a tooltip defined. When the user hovers the mouse over it, the global GUI.tooltip is set to the tooltip.


public GUIContent(GUIContent src);

Description

Build a GUIContent as a copy of another GUIContent.

Did you find this page useful? Please give it a rating: