Templates Package#
Submodules#
Playback Template#
- class visualizer.templates.playback_template.PlaybackButtons(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
Bases:
FlagThese are enums that are used to represent the playback buttons on the visualizer. They inherit from Flag and not Enum because Flag enums can use bitwise operators (& AND, | OR, ^ XOR, ~ INVERT). This allows for multiple values to be returned at the same time. Refer to https://docs.python.org/3.11/library/enum.html#enum.Flag to read more on it.
- END_BUTTON = 32#
- FASTEST_SPEED_BUTTON = 256#
- FAST_SPEED_BUTTON = 128#
- NEXT_BUTTON = 4#
- NORMAL_SPEED_BUTTON = 64#
- PAUSE_BUTTON = 1#
- PREV_BUTTON = 8#
- SAVE_BUTTON = 2#
- START_BUTTON = 16#
- class visualizer.templates.playback_template.PlaybackTemplate(screen: Surface)[source]#
Bases:
objectThis class provides a menu of buttons during runtime of the visualizer to control the playback of the visualizer, including pausing, start, end, frame scrubbing, speeding up, and slowing down, as well as saving it to a .mp4 file.
Buttons from this template are centered at the bottom of the screen, placed in three rows of three.
- playback_events(event: <module 'pygame.event' from 'C:\\Users\\ianth\\.virtualenvs\\byte_le_engine\\Lib\\site-packages\\pygame\\event.cp311-win_amd64.pyd'>) PlaybackButtons[source]#
This handles all the playback events. By using the given event, this will return the playback buttons and execute each one’s function. This is done by using the reduce() method. Read the documentation on the reduce() method for more information. Refer to the Button class for more information on how the mouse.clicked() method works. :param event: :return: PlaybackButtons