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 to0.0.scale: Scale multiplier. Defaults to(1, 1).anchor: Anchor point for positioning. Defaults toAnchor.TOP_LEFT.pivot: Normalized rotation pivot. Defaults to(0.5, 0.5)for center.
Properties
| Name | Description | Type |
|---|---|---|
pos | Position component | Vec2 |
size | Explicit size (empty = use texture size) | Vec2 |
angle | Rotation component in radians | float |
scale | Scale component | Vec2 |
anchor | Anchor point for positioning | Anchor |
pivot | Normalized pivot point for rotation | Vec2 |