simplay.events — Visual Event Types¶
- class simplay.events.VisualEvent(for_id: str, timestamp: int | float, action: EventAction, **kwargs: dict)¶
Base class for all visual events.
- Parameters:
for_id – The if of the component this event is for.
timestamp – The timestamp of the event.
action – The action to be performed.
kwargs – The arguments for the action.
- Raises:
- class simplay.events.SetVisible(for_id: str, timestamp: int | float, visible: bool)¶
Event to set the visibility of a component.
- Parameters:
for_id – The if of the component this event is for.
timestamp – The timestamp of the event.
visible – Whether the component should be visible or not.
- Raises:
TypeError – If visible is not a boolean.
- class simplay.events.SetPosition(for_id: str, timestamp: int | float, x: int, y: int)¶
Event to set the position of a component.
- class simplay.events.SetInteracting(for_id: str, timestamp: int | float, with_id: str)¶
Event to set the interaction of a component.
- Parameters:
for_id – The if of the component this event is for.
timestamp – The timestamp of the event.
with_id – The id of the component the first component is interacting with.
- Raises:
TypeError – If with_id is not a string.
- class simplay.events.SetNotInteracting(for_id: str, timestamp: int | float, with_id: str)¶
Event to set the interaction of a component.
- Parameters:
for_id – The if of the component this event is for.
timestamp – The timestamp of the event.
with_id – The id of the component the first component is interacting with.
- Raises:
TypeError – If with_id is not a string.
- class simplay.events.MoveNear(for_id: str, timestamp: int | float, target_id: str)¶
Event to move a component near another component.
- Parameters:
for_id – The if of the component this event is for.
timestamp – The timestamp of the event.
target_id – The id of the component the first component should move near.
- Raises:
TypeError – If target_id is not a string.
- class simplay.events.MoveNearCell(for_id: str, timestamp: int | float, x: int, y: int)¶
Event to move a component near a cell in the grid.
- class simplay.events.SetTintColor(for_id: str, timestamp: int | float, color: int)¶
Event to set the tint color of a component.
- Parameters:
for_id – The if of the component this event is for.
timestamp – The timestamp of the event.
color – The tint of the component. This only works with visuals and sprites that have transparent pixels. The tint is applied to the pixelsthat are not transparent. To use HEX values, write them as 0xRRGGBB. For example: 0xFF0000 is red, 0x00FF00 is green, 0x0000FF is blue.
- Raises:
TypeError – If color is not a string.
- class simplay.events.SetSpriteFrame(for_id: str, timestamp: int | float, frame: int)¶
Event to set the sprite frame of a component.
- Parameters:
for_id – The if of the component this event is for.
timestamp – The timestamp of the event.
frame – The frame to set the sprite to.
- Raises:
TypeError – If frame is not an integer.
- class simplay.events.SetDecoratingText(for_id: str, timestamp: int | float, text: str)¶
Event to set the decorating text of a component.
- Parameters:
for_id – The if of the component this event is for.
timestamp – The timestamp of the event.
text – The text to set as decorating text.
- Raises:
TypeError – If text is not a string.
- class simplay.events.ResourceSetCapacity(for_id: str, timestamp: int | float, capacity: int)¶
Event to set the capacity of a resource.
- Parameters:
for_id – The if of the component this event is for.
timestamp – The timestamp of the event.
capacity – The capacity to set the resource to.
- Raises:
TypeError – If capacity is not a positive integer.
- class simplay.events.ResourceSetUtilization(for_id: str, timestamp: int | float, utilization: int)¶
Event to set the utilization of a resource.
- Parameters:
for_id – The if of the component this event is for.
timestamp – The timestamp of the event.
utilization – The utilization to set the resource to.
- Raises:
TypeError – If utilization is not a integer.
- class simplay.events.ContainerSetCapacity(for_id: str, timestamp: int | float, capacity: int | float)¶
Event to set the capacity of a container.
- Parameters:
for_id – The if of the component this event is for.
timestamp – The timestamp of the event.
capacity – The capacity to set the container to.
- Raises:
TypeError – If capacity is not a positive integer.
- class simplay.events.ContainerSetLevel(for_id: str, timestamp: int | float, level: int | float)¶
Event to set the level of a container.
- Parameters:
for_id – The if of the component this event is for.
timestamp – The timestamp of the event.
level – The level to set the container to.
- Raises:
TypeError – If level is not a positive integer or float.
- class simplay.events.StoreSetCapacity(for_id: str, timestamp: int | float, capacity: float | int)¶
Event to set the capacity of a store.
- Parameters:
for_id – The if of the component this event is for.
timestamp – The timestamp of the event.
capacity – The capacity to set the store to.
- Raises:
TypeError – If capacity is not a positive integer or float.