Animation¶
- class Animation(frames: Dict[str, List[Image]], frame_duration: float = 0.6, loop: bool = True, starting_frame_set_name: str = None, uses_simulation_time: bool = True)[source]¶
Bases:
object
Class to hold visual information for a series of images
- __init__(frames: Dict[str, List[Image]], frame_duration: float = 0.6, loop: bool = True, starting_frame_set_name: str = None, uses_simulation_time: bool = True)[source]¶
- flash(colour: Tuple[int, int, int], duration: float = 0.05)[source]¶
Change the colour of the sprite for a given period.
- get_frame(frame_num: int) nqp.base_classes.image.Image [source]¶
Return the Image of the nth frame
- property image: nqp.base_classes.image.Image¶
Return the current frame.
- set_current_frame_set_name(frame_set_name: str)[source]¶
Set the frame set to be used.
If the name given isnt a valid key no action is taken.
- property surface: pygame.Surface¶
Return the current frame’s surface.