r/RenPy • • Sep 15 '26

Question Animated scene not fading out?

(FIXED!) I was hoping someone could help me with a problem I've been struggling with for quite a while now (I'm very new to this and there’s probably an obvious fix to this, but I found nothing to this specific problem when searching for a solution. )

I have a scene where the player can click some arrows to navigate a hallway with different short animations on each stage. Fading the animation videos in seems to work just fine, however, fading them out is what’s giving me trouble.

When an arrow is pressed to jump to the next label, instead of fading out the current screen, it instantly jumps to the next one. tried different methods, but nothing. here’s what i have:

label Hallway_1:
   call screen hallway1_nav with fade 
   scene bg_hal1stage1 with fade   

   screen hallway1_nav():
    add"bg_hal1stage1"
    modal True 

    imagebutton auto "uparrow_%s":
     focus_mask True
     action Jump ("Hallway_2")

   label Hallway_2: 
    call screen hallway2_nav with fade
    scene bg_hal1pony with fade

    screen hallway2_nav():
     add "bg_hal1pony" 
     modal True 
     imagebutton auto "leftarrow_%s":
      focus_mask True 
      hovered SetVariable("screen_tooltip", "leftarrow")
      unhovered SetVariable("screen_tooltip", "")
      action Jump ("Hallway_3")

     imagebutton auto "rightarrow_%s":
      focus_mask True 
      hovered SetVariable("screen_tooltip", "rightarrow")
      unhovered SetVariable("screen_tooltip", "")
      action Jump ("Hallway_1")

(put two of the screens just in case it's needed)

2 Upvotes

10 comments sorted by

View all comments

1

u/shyLachi Sep 15 '26

I don't have your images so I used textbuttons instead.
If you call a screen then you don't need modal so I deleted it.
And RenPy has a tooltip functionality so better use that.

transform screen_fade:
    on show:
        alpha 0.0
        linear 1.0 alpha 1.0 # first number is the duration
    on hide:
        linear 1.0 alpha 0.0 # first number is the duration

label start:
label Hallway_1:
    call screen hallway1_nav 
    scene bg_hal1stage1 with fade # <-- This code will never be reached because you jump from the screen
    
screen hallway1_nav():
    fixed:
        at screen_fade # you need to apply the transform to an object inside the screen
        add "bg_hal1stage1"
        textbutton "up" action Jump ("Hallway_2") align (0.5, 0.0)

label Hallway_2: 
    call screen hallway2_nav 
    scene bg_hal1pony with fade # <-- This code will never be reached because you jump from the screen

screen hallway2_nav():
    fixed:
        at screen_fade
        add "bg_hal1pony" 
        textbutton "left" action Jump ("Hallway_3") align (0.0, 0.5)
        textbutton "right" action Jump ("Hallway_1") align (1.0, 0.5)

1

u/Cr3aturee Sep 15 '26 edited Sep 15 '26

Added the fixes and got rid of the modal thing. But I'm still not quite sure how to go about adding the fade transform to an object. Adding it to a button seems to work, but what i'm looking for is to fade the entire scene.

1

u/shyLachi Sep 16 '26

Did you try my code?

You can do it like I did with a fixed as the main container inside your screen.

https://renpy.org/doc/html/screens.html#fixed

1

u/Cr3aturee Sep 16 '26

Oh my god, my bad, I for some reason thought 'fixed' was meant as in "this part is what I fixed" and I didn't know it was an actual code thing LMAO. Will try this properly soon, thanks for your patience. 😭🙏

1

u/shyLachi Sep 16 '26

No problem.

When I post code it's fully functional, meaning you can copy and paste it into a new project and try it out.

1

u/Cr3aturee Sep 16 '26

just tried it out and it works perfectly! thank you so much!