Page 1 of 1

On hide transform not working with buttons.

Posted: Fri Jun 17, 2022 11:46 am
by missiya4
Hi all. Today I encountered a problem that "on hide" transform stops working for screen menu elements that have at least one button or textbutton in them.
This happens when I need to exit the menu with the right mouse button or with Return().
Has anyone encountered this problem before?

Here's an example:

Code: Select all

transform show_hide_moves(diff_x=100):
    on show:
        xoffset diff_x
        linear .3 xoffset 0
    on hide:
        xoffset 0
        linear .2 xoffset -diff_x

screen test_screen():
    tag menu
    
    frame at show_hide_moves:
        null        # There may be text, images etc. Everything works well.
        textbutton "1111"  # But with any buttons/textbuttons/imagebuttons "on hide" stops working.


# Another screen...
# ...
    textbutton "Open Test Menu" action [ShowMenu("test_screen")]


Re: On hide transform not working with buttons.

Posted: Fri Jun 17, 2022 12:27 pm
by Alex
missiya4 wrote:
Fri Jun 17, 2022 11:46 am
...
Try it like - viewtopic.php?f=8&t=64720#p552761

Re: On hide transform not working with buttons.

Posted: Fri Jun 17, 2022 2:15 pm
by missiya4
Alex wrote:
Fri Jun 17, 2022 12:27 pm
Try it like - viewtopic.php?f=8&t=64720#p552761
I have no problem with the menu opening animation. There is nothing wrong with it.
I only have a problem with closing the menu (right-click or Return().

Tried your method, but it does not work fully.
At best, it leaves behind a completely opaque copy, which takes much longer to disappear than what moves in front of that copy.
Because of this, only a small wave effect is created, but the desired result is almost absent. The participation of alpha in the animation does not help either. :?

Re: On hide transform not working with buttons.

Posted: Fri Jun 17, 2022 3:26 pm
by RicharDann
Your first post's example seems to be working for me on Ren'Py 7.4.2. Are you trying this on a newer version?

Re: On hide transform not working with buttons.

Posted: Sat Jun 18, 2022 5:28 am
by missiya4
RicharDann wrote:
Fri Jun 17, 2022 3:26 pm
Are you trying this on a newer version?
I have not yet been able to update Ren'Py for the sake of testing.
I just have a lot of manual engine fixes. :?
Can you try this example to be sure?

Code: Select all

transform show_hide_moves(diff_x=100):
    on show:
        xoffset diff_x
        linear .3 xoffset 0
    on hide:
        xoffset 0
        linear .2 xoffset -diff_x

screen test_screen():
    tag menu

    frame xysize(422,222) align(.5,.2) at show_hide_moves:
        null
        text "This frame should go to the left when the right mouse button is clicked.\nThat's OK."

    frame xysize(422,222) align(.5,.7) at show_hide_moves:
        null
        text "This frame will NOT go to the left, but will simply disappear through transparency.\nBut that's wrong."
        textbutton "Textbutton" align (.5,1.0)
        
# Another screen...
# ...
    #textbutton "Open Test Menu" action [ShowMenu("test_screen")]
        
Normally, when you right click, both frames should go to the left before disappearing completely.
But if it happens the way it's written on them, it's wrong.
Thanks.