Animating say screen elements with on show

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
Ultra_HR
Regular
Posts: 39
Joined: Tue Dec 02, 2014 4:50 pm
Completed: Surkea, Arcadia, Cerulean
Projects: Missing Stars
Organization: Somnova Studios
IRC Nick: Ultra_HR
Contact:

Animating say screen elements with on show

#1 Post by Ultra_HR »

Hi,

I'm having trouble trying to animate some elements of my say screen with transforms that use on show. Here is my say screen:

Code: Select all

screen say(who, what):
    style_prefix "say"
    
    frame:
        background Frame("gui/divider.webp", 2, 0, tile = True) at dividercrop ## Might re-introduce this later. on show doesn't work, currently.
        yoffset 1080
        pos (199, -262)
        xysize (1522, 2)

    window:
        id "window"
        add Solid(gui.border_edge, xalign = 1.0, xoffset = 1, xysize = (1, 160))
        
        text what id "what":
            xpos 37
            ypos 10
            xsize 1195
            line_spacing 4
            size 31

        window:
            style "namebox"
            add Solid(gui.border_edge, xpos = -1, xysize = (1, 60))
            if who is not None:
                text who + ":" id "who":
                    size 36
                    xpos 19
                    yalign 0.5

style say_window:
    yanchor 1.0
    pos (440, -80)
    xysize (1280, 160)
    yoffset 1080
    background Solid(gui.box_background_color)

style namebox:
    xpos -240
    xysize (220, 60)
    background Solid(gui.box_background_color)
Here is the "dividercrop" transform that's referenced when adding the frame near the top:

Code: Select all

transform dividercrop:
        crop_relative True
        on hide:
            crop (0, 0, 1, 1) alpha 1.0
            ease gui.animspeed crop (0, 0, 0, 1) alpha 1.0
        on show:
            crop (0, 0, 0, 1) alpha 1.0
            ease gui.animspeed crop (0, 0, 1, 1) alpha 1.0
And here's the outcome:
Image

As you can see, it works just fine whenever the box is hidden, but when it's re-shown - after a scene transition, for example - for whatever reason, the transform just isn't done. I've also tried it using on update instead of on show, and this is the result:
Image

Does anybody know how I might be able to get this to work? I've a few other animations I want to implement into the say screen, and I would guess that they would all be affected by this problem.

Thanks!
I'm the writing lead for Somnova Studios and the Annaliese route writer for Missing Stars. You can play Act 1 now. I also co-wrote Arcadia and did programming for Cerulean.

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3794
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Animating say screen elements with on show

#2 Post by Imperf3kt »

Did you try "on replaced"

That looks cool by the way.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
Ultra_HR
Regular
Posts: 39
Joined: Tue Dec 02, 2014 4:50 pm
Completed: Surkea, Arcadia, Cerulean
Projects: Missing Stars
Organization: Somnova Studios
IRC Nick: Ultra_HR
Contact:

Re: Animating say screen elements with on show

#3 Post by Ultra_HR »

Imperf3kt wrote: Thu Mar 07, 2019 7:25 pm Did you try "on replaced"

That looks cool by the way.
Thanks so much for the suggestion, and for the compliment! I've given that a try, but no luck unfortunately - using on replaced has the same result as using on show, where the transform just isn't used.
I'm the writing lead for Somnova Studios and the Annaliese route writer for Missing Stars. You can play Act 1 now. I also co-wrote Arcadia and did programming for Cerulean.

Post Reply

Who is online

Users browsing this forum: voluorem