After several frustrating attempts to create a way to skip a video with a button, I could create a solution, which so far is working perfectly. I will here share the codes for those who want to make use of this function and also to improve it. Recalling that was used to "Movie()" class, this because the "renpy.movie_cutscene()" did not support this method.
Remember to delete/replace what is written between hashtag "#".
I hope you can understand my English translated by Google!
In screens.rpy:
Code: Select all
screen skipbutton:
modal True #prevents mouse interaction and several other keys#
key "K_h" action Hide("nonexistent_screen") #prevents the screen to be hidden#
key "K_f" action Hide("nonexistent_screen") #prevents it from being toggled fullscreen#
key "mouseup_2" action Hide("nonexistent_screen") #prevents the screen to be hidden#
add ui.timer(movieTime, ui.jumps("skipmovie")) #change "movieTime" by video time in seconds or so#
imagebutton idle "buttoniIdle.png" hover "buttonHover.png" #button position parameters# focus_mask True action Jump("skipmovie")
#rename the image button files#
Code: Select all
image movie = Movie(size=(1024, 768)) #change the values pending resolution of the video#Code: Select all
label videotoplay: #change "videotoplay" to the name you want#
$ movieTime = #movie time in seconds (float)#
show movie
play movie #moviename(file)#
show screen skipbutton #to activate the skip button screen#
$ renpy.pause(hard=True) #prevent ultimately the game straight away without finishing the video#
return
label skipmovie:
hide screen skipbutton #disables the skip button screen#
stop movie
hide movie
returnCode: Select all
call videotoplay