# RectOffset

> Offsets for rectangles, borders, etc.

## Definition

* **Type:** Class
* **Namespace:** [UnityEngine](/engine/6000.6/script-reference/unityengine.md)
* **Assembly:** UnityEngine.CoreModule
* **Implements:** [IFormattable](https://learn.microsoft.com/dotnet/api/system.iformattable)

```csharp
public class RectOffset : IFormattable
```

## Remarks

Used all over the place by [GUIStyle](/engine/6000.6/script-reference/unityengine/guistyle.md).

## Constructors

| Constructor                                                                                                                                                     | Description                           |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------- |
| [RectOffset()](/engine/6000.6/script-reference/unityengine/rectoffset/ctor.md#rectoffset\(\))                                                                   | Creates a new rectangle with offsets. |
| [RectOffset(System.Int32,System.Int32,System.Int32,System.Int32)](/engine/6000.6/script-reference/unityengine/rectoffset/ctor.md#rectoffset\(int-int-int-int\)) | Creates a new rectangle with offsets. |

## Properties

| Property                                                                           | Description                            |
| ---------------------------------------------------------------------------------- | -------------------------------------- |
| [bottom](/engine/6000.6/script-reference/unityengine/rectoffset/bottom.md)         | Bottom edge size.                      |
| [horizontal](/engine/6000.6/script-reference/unityengine/rectoffset/horizontal.md) | Shortcut for left + right. (Read Only) |
| [left](/engine/6000.6/script-reference/unityengine/rectoffset/left.md)             | Left edge size.                        |
| [right](/engine/6000.6/script-reference/unityengine/rectoffset/right.md)           | Right edge size.                       |
| [top](/engine/6000.6/script-reference/unityengine/rectoffset/top.md)               | Top edge size.                         |
| [vertical](/engine/6000.6/script-reference/unityengine/rectoffset/vertical.md)     | Shortcut for top + bottom. (Read Only) |

## Methods

| Method                                                                         | Description                                       |
| ------------------------------------------------------------------------------ | ------------------------------------------------- |
| [Add](/engine/6000.6/script-reference/unityengine/rectoffset/add.md)           | Add the border offsets to a `rect`.               |
| [Remove](/engine/6000.6/script-reference/unityengine/rectoffset/remove.md)     | Remove the border offsets from a `rect`.          |
| [ToString](/engine/6000.6/script-reference/unityengine/rectoffset/tostring.md) | Returns a formatted string for this `RectOffset`. |
