# background

> The background image used by GUI elements in this given state.

## Definition

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

```csharp
public Texture2D background { get; set; }
```

### Remarks

See also: [GUIStyleState.scaledBackgrounds](/engine/6000.3/script-reference/unityengine/guistylestate/scaledbackgrounds.md).

### Examples

```csharp
using UnityEngine;

public class Example : MonoBehaviour
{
    // Assigns a texture to customStyles[0] for when the control
    // is pressed down

    Texture2D aTexture;

    void OnGUI()
    {
        if (!aTexture)
        {
            Debug.LogError("Assign a texture on the editor first");
            return;
        }
        if (GUI.skin.customStyles.Length > 0)
        {
            GUI.skin.customStyles[0].active.background = aTexture;
        }
    }
}
```
