message

All inbuilt messages.

fireform.message.animate()

Dispatches once per game tick, after the tick events and before the drae event. It exists to seperate the tick-dependent graphics logic from the tick-independent logic.

class fireform.message.base

Base message from which all other messages need to inherit.

Attributes:
name : string

The name of the message. Behaviour and systems that want to listen for a message have to implement a function called m_name. For example, if the message’s name was tick, the behaviour would have to implement m_tick.

decipher_name()

Returns the name of the message.

This should be used instead of name, since some older messages may use a function to implement their name.

class fireform.message.collision(first, second, direction)

Signals that two entities have overlapped.

fireform.system.motion will send these once per tick until they stop colliding.

This is sent as a private message, so only the entities that actually collide will receive it.

Attributes:
other : fireform.entity.entity

The other entity.

direction : string

The direction in which the entities were moving when they collided. This is only applicable when the collision mode is set to split.

class fireform.message.collision_enter(other)

Signals that two entities have overlapped.

This is sent as a private message, so only the entities that actually collide will receive it.

Attributes:
other : fireform.entity.entity

The other entity.

class fireform.message.collision_exit(other)

Signals that two entities have stopped overlapping.

This is sent as a private message, so only the entities that actually collide will receive it.

Attributes:
other : fireform.entity.entity

The other entity.

class fireform.message.collision_late(first, second)

Signals that two entities have overlapped.

This event is fired after the main round of collision events, after all objects have finished moving. If a collision event is fired, a collision_late event will be fired.

Collision late events are usefull for when the velocity of an object needs to be changed, because that could otherwise mess with some physics logic that relies on knowing the direction that the object is moving in.

class fireform.message.dead_entity(entity)

Signals that an entitity has been killed.

This is triggered when the world decides to remove it, not when entity.kill() is called.

Attributes:
entity : fireform.entity.entity

The dead entity.

class fireform.message.draw(layer)

Dispatched whenever a layer is drawn.

fireform.message.frozen_tick()

This message is dispatched once per tick while the system is paused.

class fireform.message.generic(my_name)

Generic messages which hold no data.

Attributes:
name : string

Name of the message.

class fireform.message.key_press(key, modifiers)

Signifies that a key was pressed.

Attributes:
key : fireform.input.key

The key that was pressed.

modifiers : something

The modifier keys (shift, control, etc.) That were being held when the key was pressed.

class fireform.message.key_release(key, modifiers)

Signifies that a key was released.

Attributes:
key : fireform.input.key

The key that was released.

modifiers : something

The modifier keys (shift, control, etc.) That were being held when the key was released.

class fireform.message.mouse_click(x, y, button)

Signifies the a mouse button was clicked.

Attributes:
x : float

The x position of the cursor, within the world.

y : float

The y position of the cursor, within the world.

button : something

The button that was pressed.

class fireform.message.mouse_click_raw(x, y, button)

Signifies the a mouse button was clicked.

Attributes:
x : float

The x position of the cursor, relative to the corner of the window.

y : float

The y position of the cursor, relative to the corner of the window.

button : something

The button that was pressed.

class fireform.message.mouse_move(x, y)

Signifies that the mouse was moved.

This may not trigger if the mouse is moved outside the window.

Attributes:
x : float

The x position of the cursor, within the world.

y : float

The y position of the cursor, within the world.

class fireform.message.mouse_move_raw(x, y)

Signifies that the mouse was moved.

This may not trigger if the mouse is moved outside the window.

Attributes:
x : float

The x position of the cursor, relative to the corner of the window.

y : float

The y position of the cursor, relative to the corner of the window.

class fireform.message.mouse_release(x, y, button)

Signifies the a mouse button was released.

Attributes:
x : float

The x position of the cursor, within the world.

y : float

The y position of the cursor, within the world.

button : something

The button that was released.

class fireform.message.mouse_release_raw(x, y, button)

Signifies the a mouse button was released.

Attributes:
x : float

The x position of the cursor, relative to the corner of the window.

y : float

The y position of the cursor, relative to the corner of the window.

button : something

The button that was released.

class fireform.message.new_entity(entity)

Signifies that an entitiy was added to the world.

Attributes:
entity : fireform.entity.entity

The entity that was just added to the world.

fireform.message.surpass_frozen(function)

Decorator to apply to a message handler if it should be called even if the world is frozen.

fireform.message.tick()

This message is dispatched once per game tick.

class fireform.message.update_tracked_value(key, value)
class fireform.message.window_resized(width, height)

Signifies that the window was resized.

Attributes:
width : int

The width of the window.

height : int

The height of the window.