# GUIContent

> Constructor for GUIContent in all shapes and sizes.

## Definition

* **Type:** Constructor
* **Namespace:** [UnityEngine](/engine/6000.6/script-reference/unityengine.md)
* **Assembly:** UnityEngine.IMGUIModule

## GUIContent()

Constructor for GUIContent in all shapes and sizes.

```csharp
public GUIContent()
```

### Remarks

Build an empty GUIContent.

## GUIContent(string)

Build a GUIContent object containing only text.

```csharp
public GUIContent(string text)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)):&#x20;

### Remarks

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

### Examples

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

## GUIContent(Texture)

Build a GUIContent object containing only an image.

```csharp
public GUIContent(Texture image)
```

### Parameters

**** (\[Texture]\(/engine/6000.6/script-reference/unityengine/texture)):&#x20;

### Examples

```csharp
using UnityEngine;

public class ExampleScript : MonoBehaviour
{
    public Texture icon;
    void OnGUI()
    {
        GUI.Button(new Rect(0, 30, 100, 20), new GUIContent(icon));
    }
}
```

## GUIContent(string, Texture)

Build a GUIContent object containing both `text` and an image.

```csharp
public GUIContent(string text, Texture image)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): **** (\[Texture]\(/engine/6000.6/script-reference/unityengine/texture)):&#x20;

### Examples

```csharp
using UnityEngine;

public class ExampleScript : MonoBehaviour
{
    public Texture icon;
    void OnGUI()
    {
        GUI.Button(new Rect(0, 30, 100, 20), new GUIContent("Click me", icon));
    }
}
```

## GUIContent(string, string)

Build a GUIContent containing some `text`. When the user hovers the mouse over it, the global [GUI.tooltip](/engine/6000.6/script-reference/unityengine/gui/tooltip.md) is set to the `tooltip`.

```csharp
public GUIContent(string text, string tooltip)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): **** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)):&#x20;

### Examples

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

## GUIContent(Texture, string)

Build a GUIContent containing an image. When the user hovers the mouse over it, the global [GUI.tooltip](/engine/6000.6/script-reference/unityengine/gui/tooltip.md) is set to the `tooltip`.

```csharp
public GUIContent(Texture image, string tooltip)
```

### Parameters

**** (\[Texture]\(/engine/6000.6/script-reference/unityengine/texture)): **** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)):&#x20;

## GUIContent(string, Texture, string)

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](/engine/6000.6/script-reference/unityengine/gui/tooltip.md) is set to the `tooltip`.

```csharp
public GUIContent(string text, Texture image, string tooltip)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): **** (\[Texture]\(/engine/6000.6/script-reference/unityengine/texture)): **** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)):&#x20;

## GUIContent(GUIContent)

Build a GUIContent as a copy of another GUIContent.

```csharp
public GUIContent(GUIContent src)
```

### Parameters

**** (\[GUIContent]\(/engine/6000.6/script-reference/unityengine/guicontent)):&#x20;
