I want to use a video as a background, but it doesn't seem to be working!
What the code looks like:
------------------------
image movie = Movie(channel="bg-placeholder4", play="images/bg-placeholder4.ogv", size=(1920, 1080), loop=True)
[irrelavant code]
scene movie
play music "audio/user melancholy - somber.mp3" fadein 1.0 volume 1
h "uuh. the uuh"
-------------
Instead of playing the video "bg-placeholder4.ogv", instantly, a gray checkerboard appears for a split second.
What am I doing wrong?
Thanks :^)
EDIT: I copied the code from this solution: (https://www.reddit.com/r/RenPy/comments ... ansparent/), but there is still half a second of a checkerboard screen before it displays the video.
Half a second of a checkerboard screen before the video starts...
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.
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.
-
- Newbie
- Posts: 7
- Joined: Mon Mar 04, 2024 10:29 pm
- itch: indentation
- Contact:
- Ocelot
- Lemma-Class Veteran
- Posts: 2405
- Joined: Tue Aug 23, 2016 10:35 am
- Github: MiiNiPaa
- Discord: MiiNiPaa#4384
- Contact:
Re: Half a second of a checkerboard screen before the video starts...
What you wrote is equivalent to:
You can use scene black fowwlowed by show movie to show black screen before movie loads. Which technically isn't nessesary, because screen would be black after building the game for release anyway.
Code: Select all
# scene something is just a shortcut for writing both scene and show statement.
scene # clears screen
show movie # shows movie WHEN IT LOADS AND DECODES THE FIRST FRAME. Which might take time.
< < insert Rick Cook quote here > >
-
- Newbie
- Posts: 7
- Joined: Mon Mar 04, 2024 10:29 pm
- itch: indentation
- Contact:
Re: Half a second of a checkerboard screen before the video starts...
scene black makes it look less jarring, but I'd like the video to start as soon as the player advances. I don't want a black screen flash before every video. Is that possible? Thanks for the reply :^DOcelot wrote: ↑Tue Mar 05, 2024 11:49 am What you wrote is equivalent to:You can use scene black fowwlowed by show movie to show black screen before movie loads. Which technically isn't nessesary, because screen would be black after building the game for release anyway.Code: Select all
# scene something is just a shortcut for writing both scene and show statement. scene # clears screen show movie # shows movie WHEN IT LOADS AND DECODES THE FIRST FRAME. Which might take time.
- Ocelot
- Lemma-Class Veteran
- Posts: 2405
- Joined: Tue Aug 23, 2016 10:35 am
- Github: MiiNiPaa
- Discord: MiiNiPaa#4384
- Contact:
Re: Half a second of a checkerboard screen before the video starts...
You can use a start_image parameter to provide an image which is shown after scene statement executesm but before video starts playing. If you use first frame of your video as that image, it might look better. Another way is only remove old images after movie starts playing.
< < insert Rick Cook quote here > >
-
- Newbie
- Posts: 7
- Joined: Mon Mar 04, 2024 10:29 pm
- itch: indentation
- Contact:
Re: Half a second of a checkerboard screen before the video starts...
Thanks! How would these look as code?Ocelot wrote: ↑Tue Mar 05, 2024 12:45 pm You can use a start_image parameter to provide an image which is shown after scene statement executesm but before video starts playing. If you use first frame of your video as that image, it might look better. Another way is only remove old images after movie starts playing.
This is what I tried. I noticed "spongeman" doesn't appear before the video, only a split second of black screen
-----------------------------------------------------
image movie = Movie(play="images/bg-placeholder4.ogv", image_start="spongeman")
[irrelevant code]
show movie
play music "audio/user melancholy - somber.mp3" fadein 1.0 volume 1
h "uuh. the uuh"
-----------------------------------------
-
- Newbie
- Posts: 7
- Joined: Mon Mar 04, 2024 10:29 pm
- itch: indentation
- Contact:
Re: Half a second of a checkerboard screen before the video starts...
I'm.... dumb....withtheknife wrote: ↑Tue Mar 05, 2024 12:54 pmThanks! How would these look as code?Ocelot wrote: ↑Tue Mar 05, 2024 12:45 pm You can use a start_image parameter to provide an image which is shown after scene statement executesm but before video starts playing. If you use first frame of your video as that image, it might look better. Another way is only remove old images after movie starts playing.
This is what I tried. I noticed "spongeman" doesn't appear before the video, only a split second of black screen
-----------------------------------------------------
image movie = Movie(play="images/bg-placeholder4.ogv", image_start="spongeman")
[irrelevant code]
show movie
play music "audio/user melancholy - somber.mp3" fadein 1.0 volume 1
h "uuh. the uuh"
-----------------------------------------
I wrote image_start instead of start_image.
I think that's it. That solves everything. Every time I add a video, I'll have to define both the movie and the start_image first, correct? So, in the end, I'll have a bunch of:
image scene1 = Movie(play="images/scene1.ogv", image_start="imgscene1")
image scene2 = Movie(play="images/scene2.ogv", image_start="imgscene2")
image scene3 = Movie(play="images/scene3.ogv", image_start="imgscene3")
Who is online
Users browsing this forum: No registered users