Possible to define a transform with "old_widget = None"?

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
Treladon
Regular
Posts: 40
Joined: Sat Dec 31, 2016 3:20 pm
Projects: ToMaG, Feinted Game
Organization: Kuehler-Corrada Productions
Deviantart: Journie
Contact:

Possible to define a transform with "old_widget = None"?

#1 Post by Treladon »

Hi guys,

I'd like to define a transform where "old_widget = None," but I'm having a hard time. Am I doing things all wrong??

My goal is to have a band wiperight near the top corner of my screen with the name of the song that I have playing. Then, after a moment, it will wipeleft and disappear.

This is what I currently have:

Code: Select all

    transform music_intro(new_widget, old_widget = None): 
        parallel:
            "notify.png" #the band image file
            alpha 0.0 xalign 0 yalign 0 crop (0,0,0,35)
            linear 1.0 alpha 1.0 crop (0,0,767,35) #wiperight (the size of notify.png is 767 x 35)
            3.0 #wait a moment
            linear 1.0 alpha 0.0 crop (0,0,0,35) #wipe left
        parallel:
            contains:
                new_widget #the name of the song as a text expression
                alpha 0.0 xalign 0 yalign 0 crop (0,0,0,35) size(767,35) 
                linear 1.0 alpha 1.0 crop (0,0,767,35) #wiperight
                3.0 #wait a moment
                linear 1.0 alpha 0.0 crop (0,0,0,35)
#wipeleft
And this is how I'm trying to execute it:

Code: Select all

    play music "Denial.ogg"
    show expression Text("Denial") as new_widg with music_intro
Ren'Py won't tolerate having old_widget undefined and inserting "$ old_widget = None" before "play music" doesn't make a difference . I added "as new_widg" as an experiment. It doesn't work whether it's there or not.

The malfunction I'm getting is that the background jumps from what it's supposed to be to a transparent screen briefly, then it shows "Denial" at the bottom of the screen (default size) and it doesn't disappear.

Does anyone know the answer to this puzzle?

Thanks :D
WIP: The Tasks of Messengers and Guardians - Progress Page Here!

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot], RandomHuman64