show at and hide at must be matched?

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
Valiowk
Newbie
Posts: 22
Joined: Sat Jan 02, 2016 8:32 pm
Contact:

show at and hide at must be matched?

#1 Post by Valiowk »

There are a few ATL effects I would like to use to show images. For instance:

Show effect 1:

Code: Select all

show xxx:
    alpha 0.0
    linear 0.5 alpha 0.5
Show effect 2:

Code: Select all

show xxx:
    alpha 0.0
    pause 0.5
    linear 0.5 alpha 0.5
On the other hand, when I hide images, I almost always want to use the same effect:

Code: Select all

show xxx:
    linear 0.5 alpha 0.0
I'm trying to define these ATL effects using a transform statement so that I can supply them as part of a clause later on, for example:

Code: Select all

transform dis:
    on show:
        alpha 0.0
        linear 0.5 alpha 0.5
    on hide:
        linear 0.5 alpha 0.0

transform diss:
    on show:
        alpha 0.0
        pause 0.5
        linear 0.5 alpha 0.5
My experimentation seems to indicate that writing

Code: Select all

show xxx at diss # might add other ATL commands beside diss

...

hide xxx at dis

...

show xxx at dis # might add other ATL commands beside dis
is bad (ATL effect not working properly for hide); I have to write a similar "on hide" line for "transform diss" and make sure that the show at and hide at commands are matched (both "at dis" or both "at diss") in order to achieve the intended effect.

This seems terribly inconvenient: 1) I have to keep track of which transform I used to show an image even though the hide effect is always the same; and 2) if I decide to insert some ATL effects on the image in between, it seems that hide at the matching command doesn't even work properly then. Is there a way to get around this problem?

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

Re: show at and hide at must be matched?

#2 Post by philat »

Show at a dissolve out transform and hide at a later point. Hide just doesn't play very well with ATL sometimes.

Valiowk
Newbie
Posts: 22
Joined: Sat Jan 02, 2016 8:32 pm
Contact:

Re: show at and hide at must be matched?

#3 Post by Valiowk »

philat wrote:Show at a dissolve out transform and hide at a later point. Hide just doesn't play very well with ATL sometimes.
I was afraid that would be the case. Thanks for confirming so that I don't spend ages trying to find a clean solution to a problem that just doesn't have one.

Post Reply

Who is online

Users browsing this forum: No registered users