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.
class
Range2DiTwo-dimensional float range
Static methods
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
- Padded ange
- def scaled(self, arg0: Vector2i, /) -> Range2Di
- Scaled range
- def scaled(self, arg0: int, /) -> Range2Di
- Scaled range
- def scaled_from_center(self, arg0: Vector2i, /) -> Range2Di
- Range scaled from the center
- def scaled_from_center(self, arg0: int, /) -> 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 __getstate__(self, /) -> bytes
- Dumps the in-memory representation of range min/max components
- 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 coordinates
- def __init__(self, arg0: tuple[Vector2i, Vector2i], /) -> None
- Construct a range from minimal and maximal coordinates
- def __init__(self, arg0: tuple[tuple[int, int], 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
- def __setstate__(self, arg0: bytes, /) -> None
- Treats the data as the in-memory representation of range min/max components
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: int get set
- Right edge
- top: int get set
- Top edge
- top_left: Vector2i get set
- Top left corner
- top_right: Vector2i get set
- Top right corner
Method documentation
def magnum. Range2Di. __setstate__(self,
arg0: bytes, /) -> None
Treats the data as the in-memory representation of range min/max components
Exceptions | |
---|---|
ValueError | If the data size doesn’t match type size |