[Solved]Ingame menu/choices transitions?
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.
[Solved]Ingame menu/choices transitions?
Hi I was wondering if it's possible to assign a transition to choice menus, and if so how would I go about doing that?
Last edited by somein96 on Mon Sep 28, 2015 5:38 am, edited 1 time in total.
Re: Ingame menu/choices transitions?
You can assign an ATL transform to the choice screen using on show / on hide. http://www.renpy.org/doc/html/atl.html#on-statement
Or you can apply the transform to the buttons, I guess, which are drawn in a for loop so you'd only need to apply it once.
Or you can apply the transform to the buttons, I guess, which are drawn in a for loop so you'd only need to apply it once.
- Donmai
- Eileen-Class Veteran
- Posts: 1919
- Joined: Sun Jun 10, 2012 1:45 am
- Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question, To The Girl With Sunflowers
- Projects: Slumberland
- Location: Brazil
- Contact:
Re: Ingame menu/choices transitions?
There are two approaches: common transitions or ATL transforms. You can apply a transition to a menu this way:To use an ATL transform, you must make a little edit on the choice screen. You will find it on your screens.rpy. Find these lines:and insert your transform name after the window statement:Define your transform anywhere (Personally, I like to have a separate script for my transforms):Using this second method all your in-game menus will use the same transform.
Code: Select all
menu:
with dissolve #you can use any other transition instead of dissolve
f "What color do you prefer?"
"I prefer red.":
jump red
"I prefer blue.":
jump blueCode: Select all
##############################################################################
# Choice
#
# Screen that's used to display in-game menus.
# http://www.renpy.org/doc/html/screen_special.html#choice
screen choice:
window:
style "menu_window"Code: Select all
##############################################################################
# Choice
#
# Screen that's used to display in-game menus.
# http://www.renpy.org/doc/html/screen_special.html#choice
screen choice:
window:
at fromRight
style "menu_window"Code: Select all
transform fromRight:
subpixel True
alpha 0.0 xalign 1.0 xanchor 0.0
parallel:
easein 1.0 alpha 1.0
parallel:
easein 1.0 xalign 0.5
on hide:
alpha 1 zoom 1 xanchor 0.5 yanchor 0.5
block:
linear 0.1 zoom 1.1
linear 0.5 zoom 0No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)
TOIRE NO HANAKO (A Story About Fear)
Re: Ingame menu/choices transitions?
Thank you very much! These were exactly what I was looking for =D
-
Nova Alamak
- Regular
- Posts: 71
- Joined: Sun Jun 08, 2014 1:45 pm
- Contact:
Re: [Solved]Ingame menu/choices transitions?
Thanks for the info! This was really well-answered. I was wondering if there's a similar way to also use a transition after the choice is made? Say I had my menu slide in from the left with the moveinleft transform; where would I place a moveoutleft transition to slide it on out afterward?
EDIT: Never mind! I tried the ATL method instead and my question is now invalid!
EDIT: Never mind! I tried the ATL method instead and my question is now invalid!
-
trismegistus
- Newbie
- Posts: 7
- Joined: Mon Jul 04, 2016 4:02 pm
- Contact:
Re: [Solved]Ingame menu/choices transitions?
Thanks for this. Relatedly, I was wondering if it's possible to make each menu option transition in one at a time. I tried moving the "at fromRight" statement into the for loop:
...but they all still seem to slide in at the same time. I'm guessing it's because there's nothing making it delay each subsequent option. Can I make it delay playing the transition by a slightly longer amount for each button?
Code: Select all
for caption, action, chosen in items:
if action:
button:
at fromRight
action action
style "menu_choice_button"
text caption style "menu_choice"
else:
text caption style "menu_caption"Re: [Solved]Ingame menu/choices transitions?
This will make them appear one after anotherhttps://docs.python.org/2/library/funct ... #enumerate
Code: Select all
transform my_tr(t=0):
xpos 1.2 xanchor 0.0
t*0.5
linear 1.0 xalign 0.5
screen choice(items):
window:
style "menu_window"
xalign 0.5
yalign 0.5
vbox:
style "menu"
spacing 2
for i, (caption, action, chosen) in enumerate(items):
if action:
button:
action action
style "menu_choice_button"
text caption style "menu_choice"
at my_tr(t=i)
else:
text caption style "menu_caption" at my_tr(t=i)-
trismegistus
- Newbie
- Posts: 7
- Joined: Mon Jul 04, 2016 4:02 pm
- Contact:
Re: [Solved]Ingame menu/choices transitions?
Thanks, that's just what I need. The only thing that confuses me is the line that's just "t*0.5" with no statement or anything. Does Ren'py just treat a number on its own line as "wait for this many seconds"?
Who is online
Users browsing this forum: Google [Bot], zyric
