Sweatdrop on a LiveComposite

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
PixelFade
Regular
Posts: 67
Joined: Mon Mar 25, 2013 11:20 pm
Contact:

Sweatdrop on a LiveComposite

#1 Post by PixelFade » Sat Jun 08, 2013 9:36 am

Hello,

I'm looking for some assistance with ATL and specifically, doing a sweatdrop on a LiveComposite.

Code: Select all

    image sweat:
        contains:
            linear 0 alpha 1.0
            "sweatdrop.png"
            easeout .55 yoffset 50
            
            linear .5 alpha 0.0
            "sweatdrop.png"
            linear 0 yoffset 0

            
    image MC Happy sweat = LiveComposite((500,500),(0,0), "MC Happy",(0,0),"sweat")
Right now, this works properly, but only 1 time. If I show "MC Happy sweat" again, nothing happens. If I do repeat, it also does it properly, however it would be best not to keep repeating this animation. Is there a way to tell it to go back to the top after doing it once?

Or if there is a better way to do this action, that would be great too!

Thank you for your time, regards.

Kinsman
Regular
Posts: 130
Joined: Sun Jul 26, 2009 7:07 pm
Location: Fredericton, NB, Canada
Contact:

Re: Sweatdrop on a LiveComposite

#2 Post by Kinsman » Sat Jun 08, 2013 12:13 pm

Try writing the whole animation, "MC Happy" and "sweat" both, as ATL.

Code: Select all

    image MC happy sweat:
        contains:
            "MC happy"
        contains:
            linear 0 alpha 1.0
            "sweatdrop.png"
            easeout .55 yoffset 50
           
            linear .5 alpha 0.0
            "sweatdrop.png"
            linear 0 yoffset 0
Some fiddling with anchor points and position may be needed.
Flash To Ren'Py Exporter
See the Cookbook thread

apricotorange
Veteran
Posts: 479
Joined: Tue Jun 05, 2012 2:01 am
Contact:

Re: Sweatdrop on a LiveComposite

#3 Post by apricotorange » Sat Jun 08, 2013 12:14 pm

Simple approach:

Code: Select all

    show MC Happy
    show MC Happy sweat

pwisaguacate
Veteran
Posts: 356
Joined: Mon Mar 11, 2013 11:03 pm
Contact:

Re: Sweatdrop on a LiveComposite

#4 Post by pwisaguacate » Sat Jun 08, 2013 12:52 pm

That sweat image stays stuck at the top left corner, is hard to reposition, and can be made shorter. Rewrite it like this:

Code: Select all

image sweat:
    "sweatdrop.png"
    easeout .55 yoffset 50
    linear .5 alpha 0.0
Following apricotorange's "simple approach", you may define custom transforms for many character and/or positions:

Code: Select all

transform MC_center:
    xalign .55 yalign 0.2
[...]

label start:
    show MC Happy at left
    show sweat at MC_left
    "Well..."

    return

PixelFade
Regular
Posts: 67
Joined: Mon Mar 25, 2013 11:20 pm
Contact:

Re: Sweatdrop on a LiveComposite

#5 Post by PixelFade » Sun Jun 09, 2013 8:49 am

Thank you for the assistance, here are the results:
Kinsman wrote:Try writing the whole animation, "MC Happy" and "sweat" both, as ATL.

Code: Select all

    image MC happy sweat:
        contains:
            "MC happy"
        contains:
            linear 0 alpha 1.0
            "sweatdrop.png"
            easeout .55 yoffset 50
           
            linear .5 alpha 0.0
            "sweatdrop.png"
            linear 0 yoffset 0
Some fiddling with anchor points and position may be needed.
The animation didn't occur, however the static images showed correctly.
pwisaguacate wrote:That sweat image stays stuck at the top left corner, is hard to reposition, and can be made shorter. Rewrite it like this:

Code: Select all

image sweat:
    "sweatdrop.png"
    easeout .55 yoffset 50
    linear .5 alpha 0.0
When I removed the "Contains:" and modified to this, the animation did not occur; the static image displayed correctly.
pwisaguacate wrote:Following apricotorange's "simple approach", you may define custom transforms for many character and/or positions:

Code: Select all

transform MC_center:
    xalign .55 yalign 0.2
[...]

label start:
    show MC Happy at left
    show sweat at MC_left
    "Well..."

    return
This worked. This issue is that the sprite and sweatdrop animation are not 'attached' (I was hoping this was possible in case there is movement to non-predefined locations).

I appreciate the help, looks like there might be more fiddling required...

So I'm guessing there is no way to tell the code to 'reset' after running through once after being called?

Thanks again, regards.

Post Reply

Who is online

Users browsing this forum: Google [Bot]