Welcome to Python-flavored Magnum! Please note that, while already being rather stable, this functionality is still considered experimental and some APIs might get changed without preserving full backwards compatibility.

# magnum.Range2Di class

Two-dimensional float range

• Reference

## Static methods

def from_center(arg0: Vector2i, arg1: Vector2i, /) -> Range2Di
Create a range from center and half size
def from_size(arg0: Vector2i, arg1: Vector2i, /) -> Range2Di
Create a range from minimal coordinates and size
def zero_init() -> Range2Di
Construct a zero range

## Methods

def center(self, /) -> Vector2i
Range center
def center_x(self, /) -> int
Range center on X axis
def center_y(self, /) -> int
Range center on Y axis
def contains(self, arg0: Vector2i, /) -> bool
Whether given point is contained inside the range
def contains(self, arg0: Range2Di, /) -> bool
Whether another range is fully contained inside this range
def padded(self, arg0: Vector2i, /) -> Range2Di
def scaled(self, arg0: Vector2i, /) -> Range2Di
Scaled range
self, arg0: Vector2i, /) -> Range2Di
Range scaled from the center
def size(self, /) -> Vector2i
Range size
def size_x(self, /) -> int
Range width
def size_y(self, /) -> int
Range height
def translated(self, arg0: Vector2i, /) -> Range2Di
Translated range
def x(self, /) -> Range1Di
Range in the X axis
def y(self, /) -> Range1Di
Range in the Y axis

## Special methods

def __eq__(self, arg0: Range2Di, /) -> bool
Equality comparison
def __init__(self, arg0: Range2D, /) -> None
Construct from different underlying type
def __init__(self, arg0: Range2Dd, /) -> None
Construct from different underlying type
def __init__(self, /) -> None
Default constructor
def __init__(self, arg0: Vector2i, arg1: Vector2i, /) -> None
Construct a range from minimal and maximal coordiantes
def __init__(self, arg0: typing.Tuple[Vector2i, Vector2i], /) -> None
Construct a range from minimal and maximal coordiantes
def __init__(self, arg0: typing.Tuple[typing.Tuple[int, int], typing.Tuple[int, int]], /) -> None
Construct a range from a pair of minimal and maximal coordinates
def __ne__(self, arg0: Range2Di, /) -> bool
Non-equality comparison
def __repr__(self, /) -> str
Object representation

## Properties

bottom: int get set
Bottom edge
bottom_left: Vector2i get set
Bottom left corner
bottom_right: Vector2i get set
Bottom right corner
left: int get set
Left edge
max: Vector2i get set
Maximal coordinates (exclusive)
min: Vector2i get set
Minimal coordinates (inclusive)
Right edge
top: int get set
Top edge
top_left: Vector2i get set
Top left corner
top_right: Vector2i get set
Top right corner