---
title: "Rect"
description: "API documentation for Rect"
url: https://developer.disguise.one/python-api/docs/rect/
---

# Rect

See also: [Utility Guide](/plugins/guides/utility)

Base class: _\_BlipValue_

## Properties

#### **bl** : _[Vec2](/python-api/docs/vec2#vec2)_ _(Read-Only)_

#### **br** : _[Vec2](/python-api/docs/vec2#vec2)_ _(Read-Only)_

#### **origin** : _[Vec2](/python-api/docs/vec2#vec2)_ _(Read-Only)_

#### **ox** : _float_ _(Read-Only)_

#### **oy** : _float_ _(Read-Only)_

#### **pos** : _[Vec2](/python-api/docs/vec2#vec2)_

#### **size** : _[Vec2](/python-api/docs/vec2#vec2)_

#### **tl** : _[Vec2](/python-api/docs/vec2#vec2)_ _(Read-Only)_

#### **tr** : _[Vec2](/python-api/docs/vec2#vec2)_ _(Read-Only)_

#### **x0** : _float_

#### **x1** : _float_

#### **y0** : _float_

#### **y1** : _float_

## Constructors

#### **\_\_init\_\_**(self)

#### **\_\_init\_\_**(self, other: _[Rect](/python-api/docs/rect#rect)_)

Copy constructor for Rect

#### **\_\_init\_\_**(self, pos: _[Vec2](/python-api/docs/vec2#vec2)_, size: _[Vec2](/python-api/docs/vec2#vec2)_)

#### **\_\_init\_\_**(self, x: _float_, y: _float_, w: _float_, h: _float_)

## Methods

#### **canonicalise**(self) -> _[Rect](/python-api/docs/rect#rect)_

#### **container**(self, r: _[Rect](/python-api/docs/rect#rect)_) -> _[Rect](/python-api/docs/rect#rect)_

#### **expand**(self, f: _float_) -> _[Rect](/python-api/docs/rect#rect)_

Expand rectangle by specified scalar amount on all sides, keeping origin the same.

**Parameters**:

-   f Scalar value to expand with on all sides.

**Returns** A new rectangle that is the result of the expand operation on the current one.

#### **expandPoint**(self, v: _[Vec2](/python-api/docs/vec2#vec2) | [Int2](/python-api/docs/int2#int2) | [Vec](/python-api/docs/vec#vec)_) -> _[Rect](/python-api/docs/rect#rect)_

Expand rectangle by specified vector on all sides, keeping origin the same.

**Parameters**:

-   v Vector to expand with in x and y directions.

**Returns** A new rectangle that is the result of the expand operation on the current one.

#### **intersect**(self, r: _[Rect](/python-api/docs/rect#rect)_) -> _[Rect](/python-api/docs/rect#rect)_

#### **intersects**(self, r: _[Rect](/python-api/docs/rect#rect)_) -> _bool_

#### **pointInside**(self, p: _[Vec2](/python-api/docs/vec2#vec2) | [Int2](/python-api/docs/int2#int2) | [Vec](/python-api/docs/vec#vec)_) -> _bool_

#### **rectInside**(self, r: _[Rect](/python-api/docs/rect#rect)_) -> _bool_

## Special Methods

#### **\_\_add\_\_**(self, v: _[Vec2](/python-api/docs/vec2#vec2) | [Int2](/python-api/docs/int2#int2) | [Vec](/python-api/docs/vec#vec)_) -> _[Rect](/python-api/docs/rect#rect)_

#### **\_\_eq\_\_**(self, r: _[Rect](/python-api/docs/rect#rect)_) -> _bool_

#### **\_\_ne\_\_**(self, r: _[Rect](/python-api/docs/rect#rect)_) -> _bool_

#### **\_\_repr\_\_**(self) -> _Any_

String representation of the Rect
