xecs.Transform2#
- class xecs.Transform2[source]#
Bases:
Component
Describes the position and orientation of an entity in 2D space.
Methods
Create a preallocated pool of components.
Create a transforms with random values.
Attributes
Maps each component type to a unique ID.
The translation of the entity.
The rotation of the entity.
- classmethod create_pool(capacity)#
Create a preallocated pool of components.
- Parameters:
capacity (int) – The maximum number of components the pool can hold.
- Returns:
The component pool.
- Return type:
- fill_random(generator, min_translation=(0.0, 0.0), max_translation=(10.0, 0.0))[source]#
Create a transforms with random values.