Hello everyone,
I'm new to Renpy, forgive me if this topic already have an answer somewhere (I didn't find it though).
I'm building a right click menu, using the "screen language". One of the widgets should have a transform that changes its behavior depending on if the menu it's opening or closing.
Well, using the "on" statement, since the "show" event is called, everything goes fine. The problem is that the action Return() doesn't trigger the "hide" event. I think is because the menu is called on a new context.
Anyway, there is a way to trigger manually the "hide" event when closing a screen with Return(), or maybe there is some trick to solve this problem?
Manually trig "hide" event when closing menu with Return()
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.
Manually trig "hide" event when closing menu with Return()
Last edited by nekoman on Tue Aug 19, 2014 3:56 am, edited 1 time in total.
- dyrarendy
- Regular
- Posts: 59
- Joined: Wed Apr 02, 2014 12:26 pm
- Projects: Visual Novel Dating Sims Masa SMA
- Location: Indonesia, Cimahi
- Contact:
Re: Manually trig "onhide" event when closing menu with Retu
Can i see your Script that contains Return() and "hide" event ?
Re: Manually trig "onhide" event when closing menu with Retu
There is a weird bug there even without using Return. I doubt he's doing anything wrong. There are plenty workarounds (I just don't know which one to suggest without seeing the code) and maybe PyTom can fix it in 6.18.
Re: Manually trig "onhide" event when closing menu with Retu
The actual screen script is a bit long. I'll type an equivalent.dyrarendy wrote:Can i see your Script that contains Return() and "hide" event ?
Code: Select all
# Need some setup to work
init python:
# setup transitions
config.enter_transition = Dissolve(0.3)
config.exit_transition = Dissolve(0.3)
# set game menu entry screen
_game_menu_screen = "myscreen"
#-----------------------------------------------
# A transform for the button
transform mytransform:
align (0.5, 0.5)
on show:
xoffset 300 alpha .0
easein .2 xoffset 0 alpha 1.0
# this doesn't trig with Return()
on hide:
easein .2 xoffset 300 alpha .0
#-----------------------------------------------
screen myscreen:
tag menu
vbox at mytransform:
textbutton "Close" action Return()
I think this is a big limitation.
Anyway I wanted to know if there is a manual way to trig the event.
Re: Manually trig "hide" event when closing menu with Return
I thought you meant something competely different...
Did you try:
by any chance?
Did you try:
Code: Select all
textbutton "Close" [Hide("myscreen"), action Return()]
Re: Manually trig "hide" event when closing menu with Return
Yes, it doesn't work.xela wrote:I thought you meant something competely different...
Did you try:
by any chance?Code: Select all
textbutton "Close" [Hide("myscreen"), action Return()]
Also I trying switching using variables but since the two calls belongs to different context, I couldn't get it work.
P.S.
I actually tried:
Code: Select all
textbutton "Close" action [Hide("myscreen"), Return()]
- nyaatrap
- Crawling Chaos
- Posts: 1824
- Joined: Mon Feb 13, 2012 5:37 am
- Location: Kimashi Tower, Japan
- Contact:
Re: Manually trig "hide" event when closing menu with Return
When you call a screen using renpy.calls_in_new_context, transforms don't work when you close it with return. I think transforms are killed while executing return operation even it starts working. (When it called by renpy.call_screen, then it works correctly)
Who is online
Users browsing this forum: Adabelitoo