# BeginArea

> Begin a GUILayout block of GUI controls in a fixed screen area.

## Definition

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

## BeginArea(Rect)

Begin a GUILayout block of GUI controls in a fixed screen area.

```csharp
public static void BeginArea(Rect screenRect)
```

### Parameters

**** (\[Rect]\(/engine/6000.0/script-reference/unityengine/rect)):&#x20;

### Remarks

By default, any GUI controls made using GUILayout are placed in the top-left corner of the screen. If you want to place a series of automatically laid out controls in an arbitrary area, use GUILayout.BeginArea to define a new area for the automatic layouting system to use.

Additional Resources: [GUILayout.EndArea](/engine/6000.0/script-reference/unityengine/guilayout/endarea.md)

![GUILayoutArea (BeginArea)](/api/media?file=/engine/6000.0/media/images/GUILayoutArea.png)

*Explained Area of the example.*

```csharp
using UnityEngine;

public class ExampleScript : MonoBehaviour
{
    void OnGUI()
    {
        // Starts an area to draw elements
        GUILayout.BeginArea(new Rect(10, 10, 100, 100));
        GUILayout.Button("Click me");
        GUILayout.Button("Or me");
        GUILayout.EndArea();
    }
}
```

This function is very useful when mixing GUILayout code. It must be matched with a call to EndArea. BeginArea / EndArea cannot be nested.

## BeginArea(Rect, string)

Begin a GUILayout block of GUI controls in a fixed screen area.

```csharp
public static void BeginArea(Rect screenRect, string text)
```

### Parameters

**** (\[Rect]\(/engine/6000.0/script-reference/unityengine/rect)): **** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Optional text to display in the area.

### Remarks

By default, any GUI controls made using GUILayout are placed in the top-left corner of the screen. If you want to place a series of automatically laid out controls in an arbitrary area, use GUILayout.BeginArea to define a new area for the automatic layouting system to use.

Additional Resources: [GUILayout.EndArea](/engine/6000.0/script-reference/unityengine/guilayout/endarea.md)

![GUILayoutArea (BeginArea)](/api/media?file=/engine/6000.0/media/images/GUILayoutArea.png)

*Explained Area of the example.*

```csharp
using UnityEngine;

public class ExampleScript : MonoBehaviour
{
    void OnGUI()
    {
        // Starts an area to draw elements
        GUILayout.BeginArea(new Rect(10, 10, 100, 100));
        GUILayout.Button("Click me");
        GUILayout.Button("Or me");
        GUILayout.EndArea();
    }
}
```

This function is very useful when mixing GUILayout code. It must be matched with a call to EndArea. BeginArea / EndArea cannot be nested.

## BeginArea(Rect, Texture)

Begin a GUILayout block of GUI controls in a fixed screen area.

```csharp
public static void BeginArea(Rect screenRect, Texture image)
```

### Parameters

**** (\[Rect]\(/engine/6000.0/script-reference/unityengine/rect)): **** (\[Texture]\(/engine/6000.0/script-reference/unityengine/texture)): Optional texture to display in the area.

### Remarks

By default, any GUI controls made using GUILayout are placed in the top-left corner of the screen. If you want to place a series of automatically laid out controls in an arbitrary area, use GUILayout.BeginArea to define a new area for the automatic layouting system to use.

Additional Resources: [GUILayout.EndArea](/engine/6000.0/script-reference/unityengine/guilayout/endarea.md)

![GUILayoutArea (BeginArea)](/api/media?file=/engine/6000.0/media/images/GUILayoutArea.png)

*Explained Area of the example.*

```csharp
using UnityEngine;

public class ExampleScript : MonoBehaviour
{
    void OnGUI()
    {
        // Starts an area to draw elements
        GUILayout.BeginArea(new Rect(10, 10, 100, 100));
        GUILayout.Button("Click me");
        GUILayout.Button("Or me");
        GUILayout.EndArea();
    }
}
```

This function is very useful when mixing GUILayout code. It must be matched with a call to EndArea. BeginArea / EndArea cannot be nested.

## BeginArea(Rect, GUIContent)

Begin a GUILayout block of GUI controls in a fixed screen area.

```csharp
public static void BeginArea(Rect screenRect, GUIContent content)
```

### Parameters

**** (\[Rect]\(/engine/6000.0/script-reference/unityengine/rect)): **** (\[GUIContent]\(/engine/6000.0/script-reference/unityengine/guicontent)): Optional text, image and tooltip top display for this area.

### Remarks

By default, any GUI controls made using GUILayout are placed in the top-left corner of the screen. If you want to place a series of automatically laid out controls in an arbitrary area, use GUILayout.BeginArea to define a new area for the automatic layouting system to use.

Additional Resources: [GUILayout.EndArea](/engine/6000.0/script-reference/unityengine/guilayout/endarea.md)

![GUILayoutArea (BeginArea)](/api/media?file=/engine/6000.0/media/images/GUILayoutArea.png)

*Explained Area of the example.*

```csharp
using UnityEngine;

public class ExampleScript : MonoBehaviour
{
    void OnGUI()
    {
        // Starts an area to draw elements
        GUILayout.BeginArea(new Rect(10, 10, 100, 100));
        GUILayout.Button("Click me");
        GUILayout.Button("Or me");
        GUILayout.EndArea();
    }
}
```

This function is very useful when mixing GUILayout code. It must be matched with a call to EndArea. BeginArea / EndArea cannot be nested.

## BeginArea(Rect, GUIStyle)

Begin a GUILayout block of GUI controls in a fixed screen area.

```csharp
public static void BeginArea(Rect screenRect, GUIStyle style)
```

### Parameters

**** (\[Rect]\(/engine/6000.0/script-reference/unityengine/rect)): **** (\[GUIStyle]\(/engine/6000.0/script-reference/unityengine/guistyle)): The style to use. If left out, the empty [GUIStyle](/engine/6000.0/script-reference/unityengine/guistyle.md) ([GUIStyle.none](/engine/6000.0/script-reference/unityengine/guistyle/none.md)) is used, giving a transparent background.

### Remarks

By default, any GUI controls made using GUILayout are placed in the top-left corner of the screen. If you want to place a series of automatically laid out controls in an arbitrary area, use GUILayout.BeginArea to define a new area for the automatic layouting system to use.

Additional Resources: [GUILayout.EndArea](/engine/6000.0/script-reference/unityengine/guilayout/endarea.md)

![GUILayoutArea (BeginArea)](/api/media?file=/engine/6000.0/media/images/GUILayoutArea.png)

*Explained Area of the example.*

```csharp
using UnityEngine;

public class ExampleScript : MonoBehaviour
{
    void OnGUI()
    {
        // Starts an area to draw elements
        GUILayout.BeginArea(new Rect(10, 10, 100, 100));
        GUILayout.Button("Click me");
        GUILayout.Button("Or me");
        GUILayout.EndArea();
    }
}
```

This function is very useful when mixing GUILayout code. It must be matched with a call to EndArea. BeginArea / EndArea cannot be nested.

## BeginArea(Rect, string, GUIStyle)

Begin a GUILayout block of GUI controls in a fixed screen area.

```csharp
public static void BeginArea(Rect screenRect, string text, GUIStyle style)
```

### Parameters

**** (\[Rect]\(/engine/6000.0/script-reference/unityengine/rect)): **** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Optional text to display in the area.**** (\[GUIStyle]\(/engine/6000.0/script-reference/unityengine/guistyle)): The style to use. If left out, the empty [GUIStyle](/engine/6000.0/script-reference/unityengine/guistyle.md) ([GUIStyle.none](/engine/6000.0/script-reference/unityengine/guistyle/none.md)) is used, giving a transparent background.

### Remarks

By default, any GUI controls made using GUILayout are placed in the top-left corner of the screen. If you want to place a series of automatically laid out controls in an arbitrary area, use GUILayout.BeginArea to define a new area for the automatic layouting system to use.

Additional Resources: [GUILayout.EndArea](/engine/6000.0/script-reference/unityengine/guilayout/endarea.md)

![GUILayoutArea (BeginArea)](/api/media?file=/engine/6000.0/media/images/GUILayoutArea.png)

*Explained Area of the example.*

```csharp
using UnityEngine;

public class ExampleScript : MonoBehaviour
{
    void OnGUI()
    {
        // Starts an area to draw elements
        GUILayout.BeginArea(new Rect(10, 10, 100, 100));
        GUILayout.Button("Click me");
        GUILayout.Button("Or me");
        GUILayout.EndArea();
    }
}
```

This function is very useful when mixing GUILayout code. It must be matched with a call to EndArea. BeginArea / EndArea cannot be nested.

## BeginArea(Rect, Texture, GUIStyle)

Begin a GUILayout block of GUI controls in a fixed screen area.

```csharp
public static void BeginArea(Rect screenRect, Texture image, GUIStyle style)
```

### Parameters

**** (\[Rect]\(/engine/6000.0/script-reference/unityengine/rect)): **** (\[Texture]\(/engine/6000.0/script-reference/unityengine/texture)): Optional texture to display in the area.**** (\[GUIStyle]\(/engine/6000.0/script-reference/unityengine/guistyle)): The style to use. If left out, the empty [GUIStyle](/engine/6000.0/script-reference/unityengine/guistyle.md) ([GUIStyle.none](/engine/6000.0/script-reference/unityengine/guistyle/none.md)) is used, giving a transparent background.

### Remarks

By default, any GUI controls made using GUILayout are placed in the top-left corner of the screen. If you want to place a series of automatically laid out controls in an arbitrary area, use GUILayout.BeginArea to define a new area for the automatic layouting system to use.

Additional Resources: [GUILayout.EndArea](/engine/6000.0/script-reference/unityengine/guilayout/endarea.md)

![GUILayoutArea (BeginArea)](/api/media?file=/engine/6000.0/media/images/GUILayoutArea.png)

*Explained Area of the example.*

```csharp
using UnityEngine;

public class ExampleScript : MonoBehaviour
{
    void OnGUI()
    {
        // Starts an area to draw elements
        GUILayout.BeginArea(new Rect(10, 10, 100, 100));
        GUILayout.Button("Click me");
        GUILayout.Button("Or me");
        GUILayout.EndArea();
    }
}
```

This function is very useful when mixing GUILayout code. It must be matched with a call to EndArea. BeginArea / EndArea cannot be nested.

## BeginArea(Rect, GUIContent, GUIStyle)

Begin a GUILayout block of GUI controls in a fixed screen area.

```csharp
public static void BeginArea(Rect screenRect, GUIContent content, GUIStyle style)
```

### Parameters

**** (\[Rect]\(/engine/6000.0/script-reference/unityengine/rect)): **** (\[GUIContent]\(/engine/6000.0/script-reference/unityengine/guicontent)): Optional text, image and tooltip top display for this area.**** (\[GUIStyle]\(/engine/6000.0/script-reference/unityengine/guistyle)): The style to use. If left out, the empty [GUIStyle](/engine/6000.0/script-reference/unityengine/guistyle.md) ([GUIStyle.none](/engine/6000.0/script-reference/unityengine/guistyle/none.md)) is used, giving a transparent background.

### Remarks

By default, any GUI controls made using GUILayout are placed in the top-left corner of the screen. If you want to place a series of automatically laid out controls in an arbitrary area, use GUILayout.BeginArea to define a new area for the automatic layouting system to use.

Additional Resources: [GUILayout.EndArea](/engine/6000.0/script-reference/unityengine/guilayout/endarea.md)

![GUILayoutArea (BeginArea)](/api/media?file=/engine/6000.0/media/images/GUILayoutArea.png)

*Explained Area of the example.*

```csharp
using UnityEngine;

public class ExampleScript : MonoBehaviour
{
    void OnGUI()
    {
        // Starts an area to draw elements
        GUILayout.BeginArea(new Rect(10, 10, 100, 100));
        GUILayout.Button("Click me");
        GUILayout.Button("Or me");
        GUILayout.EndArea();
    }
}
```

This function is very useful when mixing GUILayout code. It must be matched with a call to EndArea. BeginArea / EndArea cannot be nested.
