- Aug 13, 2020
- 11
- 2
Hi guys, I'll try to explain the best I can. What I'm trying to do is to make a video with different POVs that can be changed by pressing a button. By changing POVs I mean that I switch between different videos. I got that to work nicely ( it works nice functionally, code wise it might be a bit scuffed).
The last thing that I want to do is to make it so that if I watch the first video for let's say 5 seconds and then I press the "switch POV" button to get me to the next POV, I want that second video(POV) to start at the second 5 so it would look like I'm actually changing POVs and not just playing another video. Attached below is my current code
Please let me know if there is anything that you didn't understand from my question or what I would like to achieve. Also if you see any room for improvement for my current code or if you know any easier way to achieve what I already did please let me know
The last thing that I want to do is to make it so that if I watch the first video for let's say 5 seconds and then I press the "switch POV" button to get me to the next POV, I want that second video(POV) to start at the second 5 so it would look like I'm actually changing POVs and not just playing another video. Attached below is my current code
Python:
init python:
def define_videos(variable_prefix, folder, video_prefix, count, loop=False, group_name="pov_group"):
for i in range(1, count + 1):
video_id = f"{variable_prefix}{i}"
video_path = f"{folder}/{video_prefix}{i}.webm"
renpy.image(video_id, Movie(play=video_path, loop=loop, group=group_name))
define_videos("IntroVideo", "Images/IntroScenes", "IntroVideo", 20, loop=True)
screen switch_pov_videos():
textbutton "Switch POV" action [Function(switch_video)]
init python:
global current_video
current_video = "IntroVideo6"
video_sequence = {
"IntroVideo6": "IntroVideo7",
"IntroVideo7": "IntroVideo8",
"IntroVideo8": "IntroVideo9",
"IntroVideo9": "IntroVideo6",
}
def switch_video():
global current_video
next_video = video_sequence[current_video]
renpy.show(next_video)
renpy.hide(current_video)
current_video = next_video