tuxemon.states.transition.fade module

class tuxemon.states.transition.fade.FadeInTransition(state_duration=None, fade_duration=None, caller=None)[source]

Bases: FadeTransitionBase

Parameters:
  • state_duration (Optional[float]) –

  • fade_duration (Optional[float]) –

  • caller (Optional[State]) –

create_fade_animation()[source]
Return type:

None

class tuxemon.states.transition.fade.FadeOutTransition(state_duration=None, fade_duration=None, caller=None)[source]

Bases: FadeTransitionBase

Parameters:
  • state_duration (Optional[float]) –

  • fade_duration (Optional[float]) –

  • caller (Optional[State]) –

create_fade_animation()[source]
Return type:

None

shutdown()[source]

Called when state is removed from stack and will be destroyed.

This will be called: * after update when state is popped

Make sure to release any references to objects that may cause cyclical dependencies.

Return type:

None

class tuxemon.states.transition.fade.FadeTransitionBase(state_duration=None, fade_duration=None, caller=None)[source]

Bases: State

The state responsible for the battle transitions.

Parameters:
  • state_duration (Optional[float]) –

  • fade_duration (Optional[float]) –

  • caller (Optional[State]) –

color: ColorLike = (0, 0, 0)
abstract create_fade_animation()[source]
Return type:

None

draw(surface)[source]

Render the state to the surface passed. Must be overloaded in children.

Do not change the state of any game entities. Every draw should be the same for a given game time. Any game changes should be done during update.

Parameters:

surface (Surface) – Surface to be rendered onto.

Return type:

None

fade_duration = 1.5
force_draw = True
process_event(event)[source]

Handles player input events.

This function is only called when the player provides input such as pressing a key or clicking the mouse.

Since this is part of a chain of event handlers, the return value from this method becomes input for the next one. Returning None signifies that this method has dealt with an event and wants it exclusively. Return the event and others can use it as well.

You should return None if you have handled input here.

Parameters:

event (PlayerInput) – Player input event.

Returns:

None if the event should not be passed to the next handlers. Otherwise, return the input event.

Return type:

PlayerInput | None

state_duration = 1.0
update(time_delta)[source]

Time update function for state. Must be overloaded in children.

Parameters:

time_delta (float) – Amount of time in fractional seconds since last update.

Return type:

None