Freeze a movie on the last frame?

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
nevarran
Newbie
Posts: 6
Joined: Tue Jan 02, 2018 5:51 am
Contact:

Freeze a movie on the last frame?

#1 Post by nevarran »

Hi,
I want to use a video for the background of the main menu and I made it work using this method:

I defined the movie in my scrypt file:

Code: Select all

image intro = Movie(play="intro.webm")
and removed the original background image and placed the video in screens.rpy

Code: Select all

##add gui.main_menu_background
add "intro"
It works, but the problem is that it constantly loops. Is it possible to play it just once and freeze it on the last frame, or put an image on top of it?
Thank you.

nevarran
Newbie
Posts: 6
Joined: Tue Jan 02, 2018 5:51 am
Contact:

Re: Freeze a movie on the last frame?

#2 Post by nevarran »

Found a way, if someone is interested:

Code: Select all

screen main_menu():

    ## This ensures that any other menu screen is replaced.
    tag menu

    style_prefix "main_menu"

    add gui.main_menu_background
    add Movie(size=(1920, 1080))
    on "show" action Play("movie", "intro.webm")
    on "hide" action Stop("movie")
    on "replaced" action Stop("movie")
I added those 4 lines to the main_menu screen. Then made a pic of the last frame and set it as main_menu background (inside the giu folder). So the video plays and then you see the image, there's a little flicker, but nothing extreme.
There was a small bug - if you start the game quickly, before the video had finished, the game starts but the vid is still playing on top of it. So I added "stop movie" just after the start label.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot]