Fade for menu choices during the beginning scene
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.
- johnstag123
- Newbie
- Posts: 14
- Joined: Mon Dec 02, 2013 7:27 am
- Contact:
Fade for menu choices during the beginning scene
Hello, a the beginning of the game im making there is a set of menu choices which sa if they want to rename the mc or not. How do you make the menu choice slowly fade after one selects it only for that scene. I think it involves the renpy. wait and the with dissolve. I could make the dissolve slower by costumizing the time to like .75, but I'm not really sure how you make it that the menu choice will slowly dissolve I only know how to make it for text though. I also want to know how to make it only for that scene since I don't want all the menu choices to fade slowly like that.
Re: Fade for menu choices during the beginning scene
Try to modify choice screen a bit
Code: Select all
transform appear:
on show:
xalign .5 yalign .5
zoom .6 alpha 0.0
linear 1.5 zoom 1.0 alpha 1.0
on replace:
xalign .5 yalign .5
zoom .6 alpha 0.0
linear 1.5 zoom 1.0 alpha 1.0
on hide:
linear 1.5 zoom .6 alpha 0.0
screen choice:
if flag:
window:
style "menu_window"
xalign 0.5
yalign 0.5
at appear
vbox:
style "menu"
spacing 2
for caption, action, chosen in items:
if action:
button:
action action
style "menu_choice_button"
text caption style "menu_choice"
else:
text caption style "menu_caption"
else:
window:
style "menu_window"
xalign 0.5
yalign 0.5
vbox:
style "menu"
spacing 2
for caption, action, chosen in items:
if action:
button:
action action
style "menu_choice_button"
text caption style "menu_choice"
else:
text caption style "menu_caption"
label start:
"..."
$ flag = True # this var's value must be set before menu would be shown for the first time
menu:
"Choice 1":
pass
"Choice 2":
pass
"..."
$ flag = False # sets the value for the rest of the menus (don't set it right after the choice made otherwise you won't be able to see the hide transform)
menu:
"Choice 3":
pass
"Choice 4":
pass
"..."- johnstag123
- Newbie
- Posts: 14
- Joined: Mon Dec 02, 2013 7:27 am
- Contact:
Re: Fade for menu choices during the beginning scene
I have tried the above script and I placed it into a init python: however I'm now getting this error.
init python:
transform appear:
on show:
xalign .5 yalign .5
zoom .6 alpha 0.0
linear 1.5 zoom 1.0 alpha 1.0
on replace:
xalign .5 yalign .5
zoom .6 alpha 0.0
linear 1.5 zoom 1.0 alpha 1.0
on hide:
linear 1.5 zoom .6 alpha 0.0
screen choice:
if flag:
window:
style "menu_window"
xalign 0.5
yalign 0.5
at appear
vbox:
style "menu"
spacing 2
for caption, action, chosen in items:
if action:
button:
action action
style "menu_choice_button"
text caption style "menu_choice"
else:
text caption style "menu_caption"
else:
window:
style "menu_window"
xalign 0.5
yalign 0.5
vbox:
style "menu"
spacing 2
for caption, action, chosen in items:
if action:
button:
action action
style "menu_choice_button"
text caption style "menu_choice"
else:
text caption style "menu_caption"
File "game/script.rpy", line 58: invalid syntax
transform appear:
Re: Fade for menu choices during the beginning scene
You don't need to put it under init or init python block, just open screens.rpy, find the code for choice screen and replace it with this code - should work.
http://www.renpy.org/doc/html/atl.html# ... -statement
http://www.renpy.org/doc/html/atl.html# ... -statement
- Michiyo6918
- Veteran
- Posts: 262
- Joined: Fri Nov 11, 2011 12:26 am
- Projects: ╮(╯▽╰)╭
- Location: Look behind you
- Contact:
Re: Fade for menu choices during the beginning scene
I tried out your code and it works!!
But I have been trying and just can't seem to make any change to the interface... do you have a way to customize this menu choice button? Like I want the options to be spacing out evenly in the black box and maybe in the center? (And if I can-- is it possible to replace that black box with my own background of some sort?)
But I have been trying and just can't seem to make any change to the interface... do you have a way to customize this menu choice button? Like I want the options to be spacing out evenly in the black box and maybe in the center? (And if I can-- is it possible to replace that black box with my own background of some sort?)
Re: Fade for menu choices during the beginning scene
You need to set appropriate styles - http://lemmasoft.renai.us/forums/viewto ... =51&t=9812
By the way, are you showing your menu inside the textbox?
By the way, are you showing your menu inside the textbox?
- Michiyo6918
- Veteran
- Posts: 262
- Joined: Fri Nov 11, 2011 12:26 am
- Projects: ╮(╯▽╰)╭
- Location: Look behind you
- Contact:
Re: Fade for menu choices during the beginning scene
O- OH-OHHH Hello how stupid I am LMFAO Okay thank you for your help I finally understood XD
Yes, onto your question- All I did was copy paste the code from you so I don't know what went wrong. But I did find out how to show the menu the normal way. If I keep this code in the screen choice then the menu will appear normally. (With all the transition of course)
Yes, onto your question- All I did was copy paste the code from you so I don't know what went wrong. But I did find out how to show the menu the normal way. If I keep this code in the screen choice then the menu will appear normally. (With all the transition of course)
Code: Select all
init -2 python:
config.narrator_menu = True
style.menu_window.set_parent(style.default)
style.menu_choice.set_parent(style.button_text)
style.menu_choice.clear()
style.menu_choice_button.set_parent(style.button)
style.menu_choice_button.xminimum = int(config.screen_width * 0.75)
style.menu_choice_button.xmaximum = int(config.screen_width * 0.75)Who is online
Users browsing this forum: Google [Bot]
