Show image with parameters

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
Yuuji
Regular
Posts: 96
Joined: Tue Jan 20, 2015 3:08 am
Location: Russia, Perm
Contact:

Show image with parameters

#1 Post by Yuuji » Sun Mar 15, 2015 11:27 am

Hello! I'm trying to implement eyecatch in my game. I want to show date and time of scene in this eyecatch. I have 1-9 numbers and "X" if date is unknown as images. Date and time is in following format: 20n1n2/n3n4/n5n6 n7n8:n9n10. So I need to show 10 numbers as images in the scenario at the same time. As I know I can use 'parallel' statement to do it but... I want to assign 10 values to 10 variables(so I want to implement something like function) and in eyecatch label game should use these 10 values to find images and create parallel dissolve animation. Is there a way I can do that? As I understand ATL allows to use parameters only for trasformations. But I need to use parameters with 'image' statement or implement workaround for that. Can anyone help me with that?
There's no point in standing around with your mouth open waiting for talent to fall from the sky. You make your own. No matter what you're doing, the most essential thing is not to give up.

philat
Eileen-Class Veteran
Posts: 1853
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: Show image with parameters

#2 Post by philat » Sun Mar 15, 2015 11:50 am

Well, does it necessarily have to be wrapped in an image? You can easily do something like that with screens.

Code: Select all

init:
    transform atldissolve:
        alpha 0
        linear 0.5 alpha 1.0

screen showdate(y1, y2, m1, m2, d1, d2):
    hbox:
        xalign 0.9
        at atldissolve

        text "[y1]"
        text "[y2]"
        text "[m1]"
        text "[m2]"
        text "[d1]"
        text "[d2]"

label start:
    "blah blah"

    show screen showdate(1, 2, 3, 4, 5, 6)

User avatar
Yuuji
Regular
Posts: 96
Joined: Tue Jan 20, 2015 3:08 am
Location: Russia, Perm
Contact:

Re: Show image with parameters

#3 Post by Yuuji » Sun Mar 15, 2015 11:55 am

Thank you very much! But can this screen disappear in 2 seconds from it has been showed?
There's no point in standing around with your mouth open waiting for talent to fall from the sky. You make your own. No matter what you're doing, the most essential thing is not to give up.

philat
Eileen-Class Veteran
Posts: 1853
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: Show image with parameters

#4 Post by philat » Sun Mar 15, 2015 12:02 pm

Well, I can think of at least two ways to do it. By coding it into the transform:

Code: Select all

transform atldissolve:
    alpha 0
    linear 0.5 alpha 1.0
    pause 2
    alpha 0
Or by hiding the screen after 2 seconds.

Code: Select all

show screen blah
pause 2
hide screen blah

User avatar
Yuuji
Regular
Posts: 96
Joined: Tue Jan 20, 2015 3:08 am
Location: Russia, Perm
Contact:

Re: Show image with parameters

#5 Post by Yuuji » Sun Mar 15, 2015 12:17 pm

thank you! I'll try this.
There's no point in standing around with your mouth open waiting for talent to fall from the sky. You make your own. No matter what you're doing, the most essential thing is not to give up.

User avatar
trooper6
Lemma-Class Veteran
Posts: 3712
Joined: Sat Jul 09, 2011 10:33 pm
Projects: A Close Shave
Location: Medford, MA
Contact:

Re: Show image with parameters

#6 Post by trooper6 » Sun Mar 15, 2015 12:24 pm

What is an eyecatch?
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978

philat
Eileen-Class Veteran
Posts: 1853
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: Show image with parameters

#7 Post by philat » Sun Mar 15, 2015 12:40 pm

I had no idea either, but first result on google is from tvtropes :P http://tvtropes.org/pmwiki/pmwiki.php/Main/EyeCatch

User avatar
Yuuji
Regular
Posts: 96
Joined: Tue Jan 20, 2015 3:08 am
Location: Russia, Perm
Contact:

Re: Show image with parameters

#8 Post by Yuuji » Sun Mar 15, 2015 1:01 pm

Eyecatch is a screen with some images and some information about following scenario :) Something like opening in anime but eyecatch is displayed for a short time, about 1-3 seconds.
There's no point in standing around with your mouth open waiting for talent to fall from the sky. You make your own. No matter what you're doing, the most essential thing is not to give up.

User avatar
xavimat
Eileen-Class Veteran
Posts: 1458
Joined: Sat Feb 25, 2012 8:45 pm
Completed: Yeshua, Jesus Life, Cops&Robbers
Projects: Fear&Love, unknown
Organization: Pilgrim Creations
Github: xavi-mat
itch: pilgrimcreations
Location: Spain
Contact:

Re: Show image with parameters

#9 Post by xavimat » Sun Mar 15, 2015 7:00 pm

Another way to hide the screen is to include a timer in the screen itself:

Code: Select all

screen hello():
    text "Hello"
    timer 3.0 action Hide("hello")
Comunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)

User avatar
Yuuji
Regular
Posts: 96
Joined: Tue Jan 20, 2015 3:08 am
Location: Russia, Perm
Contact:

Re: Show image with parameters

#10 Post by Yuuji » Mon Mar 16, 2015 4:55 pm

Thank you for your answer! It's a lot of help :)
There's no point in standing around with your mouth open waiting for talent to fall from the sky. You make your own. No matter what you're doing, the most essential thing is not to give up.

Post Reply

Who is online

Users browsing this forum: Hojoo