G
The G
class represents a group (<g>
) element in SVG. It inherits from both SvgElement and Transformable to allow grouped elements to be transformed together.
Info
This class inherits from Transformable
and SvgElement
.
pydreamplet.core.G
G(
pos: Vector = None,
scale: Vector = None,
angle: float = 0,
pivot: Vector = None,
order: str = "trs",
**kwargs
)
Initializes a group element with optional transformation properties and a pivot point.
Parameters
pos
(Vector, optional): Position vector (default: (0, 0)).scale
(Vector, optional): Scale vector (default: (1, 1)).angle
(float): Rotation angle (default: 0).pivot
(Vector, optional): Pivot point for rotation (default: (0, 0)).order
(str): Transformation order (combination of 't', 'r', 's'; default: "trs").
pivot
Getter: Returns the pivot point as a Vector.
Setter: Updates the pivot point and refreshes the transform.
order
Getter: Returns the current transformation order.
Setter: Updates the order and refreshes the transform.
remove
Removes a child element. If the group becomes empty, it removes itself from its parent.
attrs
Sets multiple attributes on the group, including parsing transformation details.
from_element
Creates a G instance from an ElementTree element by parsing its transformation attributes.