# Sandbox.Painter.Mask.Mask

```csharp
Mask(Texture Texture, Rect Rect, MaskMode Mode = 1, BackgroundRepeat Repeat = 3, float Rotation = 0, FilterMode Sampling = 20)
```

An image mask positioned in drawing coordinates. Applied to the completed layer.

### Parameters

- `Texture` (`Texture`): Mask image. Must be non-null when used by a layer.
- `Rect` (`Rect`): Image position and size in drawing coordinates. Must have finite, positive dimensions.
- `Mode` (`MaskMode`), default `1`: Whether image alpha or luminance controls layer visibility. Defaults to alpha.
- `Repeat` (`BackgroundRepeat`), default `3`: Image repetition outside the mask rectangle. Defaults to no repetition.
- `Rotation` (`float`), default `0`: Rotation around the image center in degrees. Must be finite.
- `Sampling` (`FilterMode`), default `20`: Texture sampling filter. Defaults to bilinear sampling.

Declared in [Sandbox.Painter.Mask](/api/Sandbox.Painter.Mask).
Assembly: `Sandbox.Engine`.
