# ClampToBounds

> Clamps the position and size of the RectInt to the given bounds.

## Definition

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

## ClampToBounds(RectInt)

Clamps the position and size of the `RectInt` to the given bounds.

```csharp
public void ClampToBounds(RectInt bounds)
```

### Parameters

**** (\[RectInt]\(/engine/6000.5/script-reference/unityengine/rectint)): Bounds to clamp the `RectInt`.

## ClampToBounds(RectInt)

Clamps the position and size of the `RectInt` to the given bounds.

```csharp
public void ClampToBounds(in RectInt bounds)
```

### Parameters

**** (\[RectInt]\(/engine/6000.5/script-reference/unityengine/rectint)): Bounds to clamp the `RectInt`.
