Moving background in Main Menu Screen?
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.
Moving background in Main Menu Screen?
I want to make the main menu of my game have a background that moves.
I'd like it to be a sky, with clouds slowly drifting by. I tried to set the option that changes the bg image to a base of a blue sky, and add an image of clouds on top, translating, but that didn't work.
Can anyone help? What code would make this work, or is it even possible?
I'd like it to be a sky, with clouds slowly drifting by. I tried to set the option that changes the bg image to a base of a blue sky, and add an image of clouds on top, translating, but that didn't work.
Can anyone help? What code would make this work, or is it even possible?
- nyaatrap
- Crawling Chaos
- Posts: 1824
- Joined: Mon Feb 13, 2012 5:37 am
- Location: Kimashi Tower, Japan
- Contact:
Re: Moving background in Main Menu Screen?
Easy way is remove the background from main menu screen then show in label using ATL instead
You can do the similar thing in screens, but label is more accurate and flexible.
Code: Select all
label main_menu:
scene sky
show cloud:
xalign 0.0
linear 100 xlign 1.0
show screen main_menu
$ui.interact
-
- Veteran
- Posts: 356
- Joined: Mon Mar 11, 2013 11:03 pm
- Contact:
Re: Moving background in Main Menu Screen?
@nyaatrap: Could you clarify how to get label main_menu to work correctly? When I try to use it, it glitches and goes onto label start.
In the past, I've defined images with ATL blocks as seen in [link].
In the past, I've defined images with ATL blocks as seen in [link].
- nyaatrap
- Crawling Chaos
- Posts: 1824
- Joined: Mon Feb 13, 2012 5:37 am
- Location: Kimashi Tower, Japan
- Contact:
Re: Moving background in Main Menu Screen?
label main_menu is called replacing screen main_menu after label splashscreen. If there's this label, screen main_menu is nullified.
Usage of this label is pretty much same to other any labels. But you need to include a screen which has start action at the last of this label. Usually, just show screen main_menu + $ui.interact should work.
Usage of this label is pretty much same to other any labels. But you need to include a screen which has start action at the last of this label. Usually, just show screen main_menu + $ui.interact should work.
- 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: Moving background in Main Menu Screen?
I've done that directly in the Main Menu screen, adding before an init block with an ATL image, and with the "add" statement.
This way:
This way:
Code: Select all
init:
image bg fly: # defining the image with ATL. This one moves left, then right, and loops.
"bg/fly.png"
xaling 0.0
linear 5 xalign 1.0
linear 5 xalign 0.0
repeat
screen main_menu:
# This ensures that any other menu screen is replaced.
tag menu
# The background of the main menu.
window:
style "mm_root"
add "bg fly" ## Adding the moving background
# The main menu buttons.
frame:
style_group "mm"
xalign .98
yalign .98
has vbox
textbutton _("Start Game") action Start()
textbutton _("Load Game") action ShowMenu("load")
textbutton _("Preferences") action ShowMenu("preferences")
textbutton _("Help") action Help()
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)
Re: Moving background in Main Menu Screen?
I tried as well and I got
"invalid syntax
label main_menu->:"
Can someone specify how it's supposed to be used? Newb here
"invalid syntax
label main_menu->:"
Can someone specify how it's supposed to be used? Newb here
-
- Veteran
- Posts: 356
- Joined: Mon Mar 11, 2013 11:03 pm
- Contact:
Re: Moving background in Main Menu Screen?
I'm not sure how you're getting that error...
I'd go for what xavimat posted. Declare an image with an ATL block (animation code); then add it to the main menu screen. (Set mm_root to the base image in options.rpy.)
I'd go for what xavimat posted. Declare an image with an ATL block (animation code); then add it to the main menu screen. (Set mm_root to the base image in options.rpy.)
Re: Moving background in Main Menu Screen?
Thank you so much everyone! I got it to work, for the most part. For some reason I could see the image of my clouds, but they wouldn't transform across the screen. So I ended up just using a slideshow option type thing to create the illusion of movement XD
- nyaatrap
- Crawling Chaos
- Posts: 1824
- Joined: Mon Feb 13, 2012 5:37 am
- Location: Kimashi Tower, Japan
- Contact:
Re: Moving background in Main Menu Screen?
BTW, the reason why menu label is recommended is there's an issue on ui.add function. It slows down performance horribly, and some transforms couldn't work correctly.
- trooper6
- Lemma-Class Veteran
- Posts: 3712
- Joined: Sat Jul 09, 2011 10:33 pm
- Projects: A Close Shave
- Location: Medford, MA
- Contact:
Re: Moving background in Main Menu Screen?
Hi everyone! I've been working on the opening credits of my VN and sort of came up a bit stumped.
So here is the concept:
The screen is black...music begins...2 seconds pass...the title dissolves into view center...2 seconds pass...then the menu buttons dissolve into view (but the title still is visible).
Okay so I tried to do this a couple different ways.
The first thing I did was make this a main_menu label: (note there is a bit of funniness here with layers, because my master layer is smaller than the game screen.
So this didn't do what I wanted. The first thing is that pause 2 doesn't cause the screen to linger on the title for two seconds, instead the screen goes black for 2 seconds and then it brings up the main menu. How can I get the game to pause on the text?
The next issue is that it doesn't add the main_menu screen on top of what was there before, it replaces it. Which isn't actually what I wanted...because the menu disappeared.
I tried using:
But that didn't work either. a) it still replaced the original titles with the menu screen...and b) even worse, it then immediately when to the start of the game rather than waiting for a button to be pressed. So I went back to the call rather than the show.
So that wasn't working. So I created a background image that had the title on it and made that the background of the main_menu. The text expression and the background image weren't completely lined up so it looked a bit weird. So I went with this:
So I showed the bg image with the title and then called the screen main_menu with the same image as its background. That worked...but I still couldn't get the game to pause on the "show bg title onlayer overlay with Dissolve(1)" for 2 seconds, it would immediately go the the main_menu screen. So how can I get it to pause on that show bg title before calling the screen main_menu?
So anyway, what is the best way to achieve the effect that I want? And really, how do I get the thing to pause on the title for two seconds before the main menu comes up?
So here is the concept:
The screen is black...music begins...2 seconds pass...the title dissolves into view center...2 seconds pass...then the menu buttons dissolve into view (but the title still is visible).
Okay so I tried to do this a couple different ways.
The first thing I did was make this a main_menu label: (note there is a bit of funniness here with layers, because my master layer is smaller than the game screen.
Code: Select all
label main_menu:
show black onlayer underlay
play music "00 sounds/01DanseMacabre.mp3" fadeout 1
pause 2.0 #pause 1
show expression Text("THE RECKONING", size=50, yalign=0.5, xalign=0.5) onlayer overlay as text with Dissolve(1)
pause 2.0 #pause 2
call screen main_menu
The next issue is that it doesn't add the main_menu screen on top of what was there before, it replaces it. Which isn't actually what I wanted...because the menu disappeared.
I tried using:
Code: Select all
show screen main_menu
$ui.interact
So that wasn't working. So I created a background image that had the title on it and made that the background of the main_menu. The text expression and the background image weren't completely lined up so it looked a bit weird. So I went with this:
Code: Select all
label main_menu:
show black onlayer underlay
play music "00 sounds/01DanseMacabre.mp3" fadeout 1
pause 2.0 #pause 1
show bg title onlayer overlay with Dissolve(1)
pause 2.0 #pause 2
call screen main_menu
So anyway, what is the best way to achieve the effect that I want? And really, how do I get the thing to pause on the title for two seconds before the main menu comes up?
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?) Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?) Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978
Re: Moving background in Main Menu Screen?
Pause didn't work? how about this :
$ renpy.pause(2.0)
$ renpy.pause(2.0)
Meowwngg...??
- trooper6
- Lemma-Class Veteran
- Posts: 3712
- Joined: Sat Jul 09, 2011 10:33 pm
- Projects: A Close Shave
- Location: Medford, MA
- Contact:
Re: Moving background in Main Menu Screen?
I had originally tried $renpy.pause(2.0).
There is a pause, but it is a pause on a blank black screen, not on the image I want them to see.
There is a pause, but it is a pause on a blank black screen, not on the image I want them to see.
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?) Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?) Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978
Who is online
Users browsing this forum: Amazon [Bot], giorgi1111, MagicBuns, Majestic-12 [Bot]