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.scenegraph.matrix.Object2D class

Two-dimensional object with matrix-based transformation implementation

Contents

Methods

def absolute_transformation(self, /) -> Matrix3
Transformation relative to the root object
def absolute_transformation_matrix(self, /) -> Matrix3
Transformation matrix relative to the root object
def reflect(self, arg0: Vector2, /) -> None
Reflect the object
def reflect_local(self, arg0: Vector2, /) -> None
Reflect the object as a local transformation
def reset_transformation(self, /) -> None
Reset the transformation
def rotate(self, arg0: Rad, /) -> None
Rotate the object
def rotate_local(self, arg0: Rad, /) -> None
Rotate the object as a local transformation
def scale(self, arg0: Vector2, /) -> None
Scale the object
def scale_local(self, arg0: Vector2, /) -> None
Scale the object as a local transformation
def transform(self, arg0: Matrix3, /) -> None
Transform the object
def transform_local(self, arg0: Matrix3, /) -> None
Transform the object as a local transformation
def transformation_matrix(self, /) -> Matrix3
Transformation matrix
def translate(self, arg0: Vector2, /) -> None
Translate the object
def translate_local(self, arg0: Vector2, /) -> None
Translate the object as a local transformation

Special methods

def __init__(self, parent: Object2D = None) -> None
Constructor
def __init__(self, parent: Scene2D = None) -> None
Constructor

Properties

parent: Object2D get set
Parent object or None if this is the root object
scene: Scene2D get
Scene or None if the object is not a part of any scene
transformation: Matrix3 get set
Object transformation