brown.utils.rect

classes

A rectangle data object.

__init__ (x, y, width, height) permalink view source

arguments:

x (int, float, or Unit): The starting x position

y (int, float, or Unit): The starting y position

width (int, float, or Unit): The width of the rectangle

height (int, float, or Unit): The height of the rectangle

properties

pos: Point The starting (usually top-left) corner of the rect permalink view source

read-only.

x: x (int, float, or Unit) The starting x position permalink view source

read-only.

y: y (int, float, or Unit) The starting y position permalink view source

read-only.

width: width (int, float, or Unit) The width of the rectangle permalink view source

read-only.

height: height (int, float, or Unit) The height of the rectangle permalink view source

read-only.

methods

to_unit (unit) permalink view source

Translate properties to be of a certain unit type.

arguments:

unit (type): A Unit class.

returns:

Rect: the modified self rect.