gale.cutscene.cutscene module
This file contains the class Cutscene: a thin gale.sequence.Sequence of beats (see gale.cutscene.actions) that also ticks/renders any actors involved every frame, regardless of which beat is currently active – a beat like MoveActor only ever touches an actor’s .position, it doesn’t drive whatever else that actor’s own class needs updated every frame (its own sprite Animation advancing, its own render, …).
See docs/examples/cutscene.rst for a walkthrough.
Author: Alejandro Mujica (aledrums@gmail.com)
- class gale.cutscene.cutscene.Cutscene(beats, actors=None, on_finished=None)[source]
Bases:
SequenceA cutscene: a Sequence of beats, plus the one bit of bookkeeping that’s specific to cutscenes rather than sequences in general – ticking/rendering any actors involved every frame so they keep animating even on beats that don’t otherwise touch them (a character idling in the background while another one is talking, for instance).
Usage example:
- cutscene = Cutscene(
- [
MoveActor(hero, (400, 200), duration=1.5), Dialogue(“Hero”, “This way!”, font, advance_on_input=”confirm”),
], actors=[hero], on_finished=lambda: state_machine.change(“play”),
)
# In the game loop: cutscene.update(dt) cutscene.render(surface) # And forward input from wherever your game dispatches it: cutscene.on_input(input_id, input_data)
- Parameters:
beats (List[Step])
actors (Sequence[Any] | None)
on_finished (Callable[[], None] | None)