# Sandbox.UI.BaseStyles.SetRect

```csharp
void SetRect(in Rect r, float scale = 1)
```

Set Left, Right, Width and Height based on this rect. Scale can be used to scale the rect (maybe you want to use Panel.ScaleFromScreen etc)

### Parameters

- `in r` (`Rect`)
- `scale` (`float`), default `1`

Declared in [Sandbox.UI.BaseStyles](/api/Sandbox.UI.BaseStyles).
Assembly: `Sandbox.Engine`.
