Transform

2D transformations for sprites.

Constructor

Transform(
    pos: Vec2 = None,
    size: Vec2 = None,
    angle: float = 0.0,
    scale: Vec2 = None,
    anchor: Anchor = Anchor.TOP_LEFT,
    pivot: Vec2 = None
)

Parameters

  • pos : Position component. Defaults to (0, 0).
  • size : Explicit size. Defaults to empty (auto-detect from texture).
  • angle : Rotation in radians. Defaults to 0.0.
  • scale : Scale multiplier. Defaults to (1, 1).
  • anchor : Anchor point for positioning. Defaults to Anchor.TOP_LEFT.
  • pivot : Normalized rotation pivot. Defaults to (0.5, 0.5) for center.

Properties


NameDescriptionType
posPosition componentVec2
sizeExplicit size (empty = use texture size)Vec2
angleRotation component in radiansfloat
scaleScale componentVec2
anchorAnchor point for positioningAnchor
pivotNormalized pivot point for rotationVec2