How to show a screen with transitions (and parameters too)

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
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.
Post Reply
Message
Author
User avatar
runs
Regular
Posts: 41
Joined: Mon Nov 28, 2011 12:31 pm
Location: Spain
Contact:

How to show a screen with transitions (and parameters too)

#1 Post by runs » Sat Jul 16, 2016 8:12 pm

I've made a screen at top that autocloses after a time.

Code: Select all

screen comment(comment_text, time= 3):
 frame:
  xcenter 0.5
  background RoundRect("#ae426f")
  hbox:
   timer time repeat False action [Hide('comment')]
   text "{size=-3}{color=ffffff}[comment_text]{/color}{/size}"
I call it in this way:

Code: Select all

show screen comment("Hi")
It works really well!
But right now I want to improve it. My desire is that the screen appears with the transition "moveintop" and hides with the same effect.
If I call the screen:

Code: Select all

show screen comment("Hi")
with moveintop
it does not work right. Any idea for a workaround? Thanks :D

User avatar
chocoberrie
Veteran
Posts: 254
Joined: Wed Jun 19, 2013 10:34 pm
Projects: Marshmallow Days
Contact:

Re: How to show a screen with transitions (and parameters to

#2 Post by chocoberrie » Sat Jul 16, 2016 11:14 pm

I found some threads that answer this exact issue! :)

viewtopic.php?f=8&t=32626
viewtopic.php?f=8&t=21694
viewtopic.php?f=8&t=17298

I hope this helps!

User avatar
runs
Regular
Posts: 41
Joined: Mon Nov 28, 2011 12:31 pm
Location: Spain
Contact:

Re: How to show a screen with transitions (and parameters to

#3 Post by runs » Sun Jul 17, 2016 5:05 am

Thanks chocoberry! I've used the first one.

Finally I did it with dissolve because the moveintop only last 0.5 seconds on slide= too quick.
My code is now:

Code: Select all

transform show_hide_dissolve:
    on show:
        alpha .0
        linear .5 alpha 1.0
    on hide:
        alpha 1.0
        linear .5 alpha .0
        
screen comment(comment_text, time= 3):
 frame:
  at show_hide_dissolve
  xcenter 0.5
  background RoundRect("#ae426f")
  hbox:
   timer time repeat False action [Hide('comment')]
   text "{size=-3}{color=ffffff}[comment_text]{/color}{/size}" 

Code: Select all

show screen comment("Hi")

Post Reply

Who is online

Users browsing this forum: _ticlock_