Video (file) behind main menu
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: 12
- Joined: Wed Sep 04, 2013 10:02 am
- Contact:
Video (file) behind main menu
Hello everyone ! I'm here again because I would like to ask a question.
I need to display a video (like an .avi file) behind the main menu screen. I mean, the video should play and repeat, while the buttons (such as new game and options) should remain clickable as usual, but I have no idea what to do. I already tried changing the background and putting an ATL animations, but it's not what me and my friend are looking for.
I hope you guys can help, thanks in advance !
I need to display a video (like an .avi file) behind the main menu screen. I mean, the video should play and repeat, while the buttons (such as new game and options) should remain clickable as usual, but I have no idea what to do. I already tried changing the background and putting an ATL animations, but it's not what me and my friend are looking for.
I hope you guys can help, thanks in advance !
- PyTom
- Ren'Py Creator
- Posts: 16096
- Joined: Mon Feb 02, 2004 10:58 am
- Completed: Moonlight Walks
- Projects: Ren'Py
- IRC Nick: renpytom
- Github: renpytom
- itch: renpytom
- Location: Kings Park, NY
- Contact:
Re: Video (file) behind main menu
It's doable.
You have to add to the start of the main menu screen the lines
You have to add to the start of the main menu screen the lines
Code: Select all
screen main_menu:
add Movie(size=(800, 600))
on "show" action Play("movie", "foo.ogv")
on "hide" action Stop("movie")
on "replaced" action Stop("movie")
...
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
Software > Drama • https://www.patreon.com/renpytom
Re: Video (file) behind main menu
A few details I would like to point out.PyTom wrote:It's doable.
You have to add to the start of the main menu screen the lines
Code: Select all
screen main_menu: add Movie(size=(800, 600)) on "show" action Play("movie", "foo.ogv") on "hide" action Stop("movie") on "replaced" action Stop("movie") ...
1. add lines need to be sandwiched between the background window and the button box, otherwise either the movie get obscured or the button are obscured.
2. on "replace" is needed too otherwise getting into a submenu and return will make the movie disappear.
3. This have problem with the close window button for some reason. Specifically, if your menu is like this, weird thing happen when you try to close window using the X.
-
- Newbie
- Posts: 12
- Joined: Wed Sep 04, 2013 10:02 am
- Contact:
Re: Video (file) behind main menu
Thank you very much, these lines work perfectly
another question: To have the video loop continuosly, what should I have to do ?
another question: To have the video loop continuosly, what should I have to do ?
- PyTom
- Ren'Py Creator
- Posts: 16096
- Joined: Mon Feb 02, 2004 10:58 am
- Completed: Moonlight Walks
- Projects: Ren'Py
- IRC Nick: renpytom
- Github: renpytom
- itch: renpytom
- Location: Kings Park, NY
- Contact:
Re: Video (file) behind main menu
I think it's:
Play("movie", "foo.ogv", loop=True)
Play("movie", "foo.ogv", loop=True)
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
Software > Drama • https://www.patreon.com/renpytom
-
- Newbie
- Posts: 12
- Joined: Wed Sep 04, 2013 10:02 am
- Contact:
Re: Video (file) behind main menu
I realized it just after I posted, and it worked by writing "loop=1" but I guess it's the same thing... Thank you very much !
Re: Video (file) behind main menu
Wait, are you saying that you managed to fix the close window problem? How did you do it?cementoliquido wrote:Thank you very much, these lines work perfectly
another question: To have the video loop continuosly, what should I have to do ?
-
- Newbie
- Posts: 12
- Joined: Wed Sep 04, 2013 10:02 am
- Contact:
Re: Video (file) behind main menu
Sorry, I didn't answer before because of a connection problem
Anyway, I didn't actually solve this "close window" problem, in fact, when I want to close the window, only the menu disappears while the video keeps playing... I tried something but I didn't get anywhere
I don't know if this can be done properly.. Do you have any ideas ?
Thanks for your help, I really appreciate it
Anyway, I didn't actually solve this "close window" problem, in fact, when I want to close the window, only the menu disappears while the video keeps playing... I tried something but I didn't get anywhere
I don't know if this can be done properly.. Do you have any ideas ?
Thanks for your help, I really appreciate it
- Zelika
- Newbie
- Posts: 7
- Joined: Mon Nov 04, 2013 11:01 pm
- Projects: Blind
- IRC Nick: ValerieXarichi
- Location: Philippines
- Contact:
Re: Video (file) behind main menu
I'm a newbie at Ren'Py coding and I was wondering that
I followed the instructions in this topic, (even changed the foo.ogv) but when I tested it out, my main menu is still the same before (▰˘︹˘▰)
can anyone help please?
I followed the instructions in this topic, (even changed the foo.ogv) but when I tested it out, my main menu is still the same before (▰˘︹˘▰)
can anyone help please?
- xavimat
- Eileen-Class Veteran
- Posts: 1461
- Joined: Sat Feb 25, 2012 8:45 pm
- Completed: Yeshua, Jesus Life, Cops&Robbers
- Projects: Fear&Love
- Organization: Pilgrim Creations
- Github: xavi-mat
- itch: pilgrimcreations
- Location: Spain
- Discord: xavimat
- Contact:
Re: Video (file) behind main menu
@Zelika: Can you show your code of the screen main_menu?
Comunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)
- Zelika
- Newbie
- Posts: 7
- Joined: Mon Nov 04, 2013 11:01 pm
- Projects: Blind
- IRC Nick: ValerieXarichi
- Location: Philippines
- Contact:
Re: Video (file) behind main menu
Sure.xavimat wrote:@Zelika: Can you show your code of the screen main_menu?
Code: Select all
screen main_menu:
add Movie(size=(2184, 1900))
on "show" action Play("movie", "Opening/Hello Laughter.mp4")
on "hide" action Stop("movie")
on "replaced" action Stop("movie")
# This ensures that any other menu screen is replaced.
tag menu
# The background of the main menu.
window:
style "mm_root"
# The main menu buttons.
frame:
style_group "mm"
xalign .5
yalign .5
has vbox
textbutton _("Start Game") action Start()
textbutton _("Load Game") action ShowMenu("load")
textbutton _("Options") action ShowMenu("preferences")
textbutton _("Quit") action Quit(confirm=False)
init -2 python:
# Make all the main menu buttons be the same size.
style.mm_button.size_group = "mm"
い あm すch あn おたく。。。
い ぃけ いt!
- xavimat
- Eileen-Class Veteran
- Posts: 1461
- Joined: Sat Feb 25, 2012 8:45 pm
- Completed: Yeshua, Jesus Life, Cops&Robbers
- Projects: Fear&Love
- Organization: Pilgrim Creations
- Github: xavi-mat
- itch: pilgrimcreations
- Location: Spain
- Discord: xavimat
- Contact:
Re: Video (file) behind main menu
Elmiwisa has pointed out that:
I have'nt checked but, maybe you can put your movie after the "window":Elmiwisa wrote:1. add lines need to be sandwiched between the background window and the button box, otherwise either the movie get obscured or the button are obscured.
Code: Select all
screen main_menu:
on "show" action Play("movie", "Opening/Hello Laughter.mp4")
on "hide" action Stop("movie")
on "replaced" action Stop("movie")
# This ensures that any other menu screen is replaced.
tag menu
# The background of the main menu.
window:
style "mm_root"
add Movie(size=(2184, 1900))
# The main menu buttons.
frame:
style_group "mm"
xalign .5
yalign .5
has vbox
textbutton _("Start Game") action Start()
textbutton _("Load Game") action ShowMenu("load")
textbutton _("Options") action ShowMenu("preferences")
textbutton _("Quit") action Quit(confirm=False)
Comunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)
- Zelika
- Newbie
- Posts: 7
- Joined: Mon Nov 04, 2013 11:01 pm
- Projects: Blind
- IRC Nick: ValerieXarichi
- Location: Philippines
- Contact:
Re: Video (file) behind main menu
I tried that, but my menu still hasn't changed.... (sorry for the late reply)xavimat wrote:Elmiwisa has pointed out that:I have'nt checked but, maybe you can put your movie after the "window":Elmiwisa wrote:1. add lines need to be sandwiched between the background window and the button box, otherwise either the movie get obscured or the button are obscured.Code: Select all
screen main_menu: on "show" action Play("movie", "Opening/Hello Laughter.mp4") on "hide" action Stop("movie") on "replaced" action Stop("movie") # This ensures that any other menu screen is replaced. tag menu # The background of the main menu. window: style "mm_root" add Movie(size=(2184, 1900)) # The main menu buttons. frame: style_group "mm" xalign .5 yalign .5 has vbox textbutton _("Start Game") action Start() textbutton _("Load Game") action ShowMenu("load") textbutton _("Options") action ShowMenu("preferences") textbutton _("Quit") action Quit(confirm=False)
い あm すch あn おたく。。。
い ぃけ いt!
- Aurelius
- Newbie
- Posts: 20
- Joined: Fri Jun 06, 2014 6:56 pm
- Projects: Secrets of the Ark, Degrees of Freedom
- Organization: Bleau Eye Entertainment
- Location: United States
- Contact:
Re: Video (file) behind main menu
Thank you cementoliquido for asking that question and thank you PyTom for answering now I have fully functionable animated backgrounds for my main menu
Re: Video (file) behind main menu
I have a movie background that is made to be in sync with an audio. If I use the code Pytom suggested then I get the synced audio-video just once. Clicking a menu button and then returning to menu breaks the sync. The audio doesn't break it's loop but the video does.
How do I make it so that the video doesn't break it's loop regardless of me clicking other menu buttons and then going back to main menu again?
This is the code I'm using
How do I make it so that the video doesn't break it's loop regardless of me clicking other menu buttons and then going back to main menu again?
This is the code I'm using
Code: Select all
screen main_menu():
# This ensures that any other menu screen is replaced.
tag menu
add Movie(size=(1920, 1080))
on "show" action Play("movie", "gui/main_menu.ogv", loop=True)
on "hide" action Stop("movie")
on "replace" action Play("movie", "gui/main_menu.ogv", loop=True)
on "replaced" action Stop("movie")
Who is online
Users browsing this forum: No registered users