pymasep.interface.cut_scene_interface_state =========================================== .. py:module:: pymasep.interface.cut_scene_interface_state Classes ------- .. autoapisummary:: pymasep.interface.cut_scene_interface_state.CutSceneInterfaceState Module Contents --------------- .. py:class:: CutSceneInterfaceState(sub_application, video_path, audio_path, scene_name) Bases: :py:obj:`pymasep.interface.interface_state.InterfaceState` Interface state to handle a cut scene with video EXPERIMENTAL: because of performance issues, caused by cv2 random access video, only small video (small resolution and/or old format) are fully supported Otherwise, the video will be displayed, but the user event would be delayed/not handled during video playing. Wait for the pygame sdl video support. Helped from https://www.reddit.com/r/pygame/comments/12kl1m6/playing_video_and_sound_simultaneously/# and https://forum.opencv.org/t/cap-set-cv2-cap-prop-pos-msec-changes-to-unreachable-timestamp/6561. Thanks! :param sub_application: the interface to display the video on :param video_path: the path to the video file :param audio_path: the path to the audio file :scene_name: the name of the game phase when the video is played .. py:attribute:: video_path the path to the video file .. py:attribute:: audio_path the path to the audio file .. py:attribute:: scene_name the name of the game phase when the video is played .. py:attribute:: video :value: None the video object .. py:attribute:: ended :value: False the video has finished .. py:attribute:: current_ts :value: 0 current timestamp of the video .. py:attribute:: image :value: None image used to display the video .. py:method:: init() Initialisation of the state .. py:method:: clean() The state is destroyed. Clean all elements of the state (including ui_container) .. py:method:: handle_event(event) Handle events to close the cut scene :param event: the event .. py:method:: render(time_delta) Render the cut scene :param time_delta: The time delta since the last call .. py:method:: update() The update phase of the state. For interface, it corresponds to choose action, send action and receive observation.