directional¶
- class DirectionalMixin(
- direction=
Direction.NORTH, - *,
- extra_keys: dict[str, Any] | None =
None, Permits this entity to be able to specify its
directionattribute, a discrete rotation value. Exactly how many directions an entity can occupy (no-rotation, 4-way, 8-way, 16-way) is determined via it’sflags.All entities are directional, except for vehicle/rolling stock entities, which instead have an
orientation.See also
- property collision_set_rotated : bool¶
Whether or not this entity actually has their collision set rotated by their direction. Some entities (such as rail signals) have many valid directions they can exist as but reuse the same collision set for all of them.
- direction : Direction¶
Serialized
This attribute is imported/exported from blueprint strings.
The direction that the Entity is facing. An Entity’s “front” is usually the direction of it’s outputs, if it has any.
For some entities, this attribute may be redundant; for example, the direction value for an
AssemblingMachineonly matters if the machine has a fluid input or output.Raises
DirectionWarningif set to a direction not contained withinvalid_directions.- Raises:
DraftsmanError – If the direction is set while inside a Collection, and the target entity is both non-square and the particular rotation would change it’s apparent tile width and height. See, here for more info.