screen before 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.
- black_hayate
- Newbie
- Posts: 7
- Joined: Sun Jul 21, 2013 2:52 pm
- Completed: in progress
- Projects: in progress
- Organization: none
- Location: far from here
- Contact:
screen before main menu screen
I need help with a splash screen or start screen(before main menu screen).
something like the image:
*if I click on the screen, go to main menu
*if I wait about 40 seconds, go to opening video
something like the image:
*if I click on the screen, go to main menu
*if I wait about 40 seconds, go to opening video
- BlueScorpion
- Newbie
- Posts: 14
- Joined: Thu Jul 25, 2013 4:01 am
- Contact:
Re: screen before main menu screen
There might be a better way to do this, but something like this technically works...
Code: Select all
init python:
show_main = False
screen main_menu:
# This ensures that any other menu screen is replaced.
tag menu
# The background of the main menu.
window:
style "mm_root"
if not show_main:
timer 40 action SetVariable('show_main', True)
textbutton '':
background None xminimum config.screen_width yminimum config.screen_height
action SetVariable('show_main', True)
text "Click to start" xalign .5 yalign .75 style style.button_text
else:
# 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)
- black_hayate
- Newbie
- Posts: 7
- Joined: Sun Jul 21, 2013 2:52 pm
- Completed: in progress
- Projects: in progress
- Organization: none
- Location: far from here
- Contact:
Re: screen before main menu screen
I can't understand the code, it's very confusing...
I'm in options.rpy where the opening and start screen(static image) code are in there
just need a simple code, anyway thanks for the help, maybe can try...
I'm in options.rpy where the opening and start screen(static image) code are in there
just need a simple code, anyway thanks for the help, maybe can try...
- BlueScorpion
- Newbie
- Posts: 14
- Joined: Thu Jul 25, 2013 4:01 am
- Contact:
Re: screen before main menu screen
If you don't care how it works, just go to screens.rpy, select the entire main menu screen (except for the style block underneath) and paste the code i provided over it.
I will try to explain it, though.
This initializes the variable used to decide whether 'Click to continue' or the menu selections are showing.
This block of code runs when show_main is False.
This line sets a timer that will set show_main to True when it expires.
This line creates an invisible button the size of the screen that sets show_main to True when clicked.
This line just creates text that says "Click to start".
This block of code runs when show_main is True. It is unchanged from the default main menu code, except that i indented it to place it under the else.
I will try to explain it, though.
This initializes the variable used to decide whether 'Click to continue' or the menu selections are showing.
Code: Select all
init python:
show_main = False
Code: Select all
if not show_main:
timer 40 action SetVariable('show_main', True)
textbutton '':
background None xminimum config.screen_width yminimum config.screen_height
action SetVariable('show_main', True)
text "Click to start" xalign .5 yalign .75 style style.button_text
Code: Select all
timer 40 action SetVariable('show_main', True)
Code: Select all
textbutton '':
background None xminimum config.screen_width yminimum config.screen_height
action SetVariable('show_main', True)
Code: Select all
text "Click to start" xalign .5 yalign .75 style style.button_text
Code: Select all
else:
# 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)
- BlueScorpion
- Newbie
- Posts: 14
- Joined: Thu Jul 25, 2013 4:01 am
- Contact:
Re: screen before main menu screen
Oh yeah... i just realized i have "Click to start" set to the button color, which may not have been the best choice. In some themes it's going to be too similar to the background.
To change the color find this line:
...and replace it with this one:
It will change the color to black.
To change the color find this line:
Code: Select all
text "Click to start" xalign .5 yalign .75 style style.button_text
Code: Select all
text "Click to start" xalign .5 yalign .75 color '#000'
- black_hayate
- Newbie
- Posts: 7
- Joined: Sun Jul 21, 2013 2:52 pm
- Completed: in progress
- Projects: in progress
- Organization: none
- Location: far from here
- Contact:
Re: screen before main menu screen
ahh ok, but, how about the opening video, I have it in a code in options.rpy in a label, like this:
next, the "click to start" screen, label too:
after this the main menu screen...
but the question is:
how i put on this timer to show the opening screen if I not click in "click to start" screen for about 40 seconds?
only if I clic on the "clic to start" screen allow me to advance to the main_menu screen
like the image i posted before
something like a game when a press start screen appears, if i press start it shows me the main menu, or if i not press anything for a long time, it returns to opening video
Code: Select all
label opening:
$renpy.movie_cutscene("opening.mpg")
Code: Select all
label starts:
scene start with dissolve
play sound "start.mp3"
$renpy.pause(40.0)
but the question is:
how i put on this timer to show the opening screen if I not click in "click to start" screen for about 40 seconds?
only if I clic on the "clic to start" screen allow me to advance to the main_menu screen
like the image i posted before
something like a game when a press start screen appears, if i press start it shows me the main menu, or if i not press anything for a long time, it returns to opening video
- BlueScorpion
- Newbie
- Posts: 14
- Joined: Thu Jul 25, 2013 4:01 am
- Contact:
Re: screen before main menu screen
Oh. Sorry, that detail got away from me. Might work if you just have the timer jump to the opening's label instead.
Code: Select all
timer 40 action Jump('opening')
Re: screen before main menu screen
how about to change the click button into something like, press F or press Spacebar to start.BlueScorpion wrote: ↑Fri Jul 26, 2013 1:38 am If you don't care how it works, just go to screens.rpy, select the entire main menu screen (except for the style block underneath) and paste the code i provided over it.
I will try to explain it, though.
This initializes the variable used to decide whether 'Click to continue' or the menu selections are showing.This block of code runs when show_main is False.Code: Select all
init python: show_main = False
This line sets a timer that will set show_main to True when it expires.Code: Select all
if not show_main: timer 40 action SetVariable('show_main', True) textbutton '': background None xminimum config.screen_width yminimum config.screen_height action SetVariable('show_main', True) text "Click to start" xalign .5 yalign .75 style style.button_text
This line creates an invisible button the size of the screen that sets show_main to True when clicked.Code: Select all
timer 40 action SetVariable('show_main', True)
This line just creates text that says "Click to start".Code: Select all
textbutton '': background None xminimum config.screen_width yminimum config.screen_height action SetVariable('show_main', True)
This block of code runs when show_main is True. It is unchanged from the default main menu code, except that i indented it to place it under the else.Code: Select all
text "Click to start" xalign .5 yalign .75 style style.button_text
Code: Select all
else: # 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)
and, is it ok if i change the Click to Start text to an imagemap/imagebutton?
Who is online
Users browsing this forum: Bing [Bot]