Screen transition problem

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
Pyro
Newbie
Posts: 22
Joined: Tue Feb 03, 2015 6:56 am
Tumblr: daily-dragon
Contact:

Screen transition problem

#1 Post by Pyro »

Hi guys!
I have an issue that I've been unable to solve all weekend.
I want to have a little notification of a player skill change pop in from the edge of the screen and then drop off of it after a short pause. I can created a small custom screen to hold the notification and its fall-off timer.

The problem is is that instead of the transitions affecting the little notice box it is affecting the whole display causing a copy of the scene to slide in from the left and then drop off. The notice box then remains on screen from then on.

Here is the screen code I have

Code: Select all

screen sKillNoteScreen(skill, score):
    timer 1.0 action Show("skillShowBox", slideright, skill, score)

screen skillShowBox(skill, score):
    vbox xalign 0.1 yalign 0.3 xfill True yfill True:
        frame xalign 0.1 yalign 0.3: 
        text skill + " " + score

    timer 0.3 action Hide("skillShow", transition=slideawaydown)
I call the screen from a function in my Character object

Code: Select all

def changeSkillBonus(self, skill, change): 
    if self.skillBonus.has_key(skill): 
        self.skillBonus[skill] += change
        renpy.show_screen("skillNoteScreen", skill, str(change))
Thanks for any help guys!

User avatar
Alex
Lemma-Class Veteran
Posts: 3094
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Screen transition problem

#2 Post by Alex »

Code: Select all

timer 0.3 action Hide("skillShow", transition=slideawaydown)
shouldn't it be

Code: Select all

timer 0.3 action Hide("skillShowBox", transition=slideawaydown)

Pyro
Newbie
Posts: 22
Joined: Tue Feb 03, 2015 6:56 am
Tumblr: daily-dragon
Contact:

Re: Screen transition problem

#3 Post by Pyro »

You have a good point. I have done some jiggery pokery to the screen code now.

Code: Select all

screen skillNoteScreen(skill, score):
    modal False
    timer 0.1 action Show("skillShowBox", slideright, skill, score)
    timer 3.0 action Hide("skillShowBox", slideawaydown)
    timer 4.0 action [Hide("skillNoteScreen"), Return()]

screen skillShowBox(skill, score):
    modal False
    vbox xalign 0.1 yalign 0.3 xfill True yfill True:
        frame xalign 0.1 yalign 0.3:
            text skill + " " + score
This now hides things nicely.
However, I still have the problem where the slideright and slideawaydown transition affects the scene background instead of just the screen components.

User avatar
Alex
Lemma-Class Veteran
Posts: 3094
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Screen transition problem

#4 Post by Alex »

That's because you've used slide transitions (they use old scene image and new one) - if you'll try to use dissolve instead it will affect screen only. So, you can create a transform that will move your screen and use it instead of slide transitions. Try

Code: Select all

screen skillNoteScreen(skill, score):
    modal False
    timer 0.1 action Show("skillShowBox", skill, score)
    timer 3.0 action Hide("skillShowBox")
    timer 4.0 action [Hide("skillNoteScreen"), Return()]

screen skillShowBox(skill, score):
    modal False
    vbox xalign 0.1 yalign 0.3 xfill True yfill True:
        at test_tr
        frame xalign 0.1 yalign 0.3:
            text skill + " " + score 

transform test_tr:
    on show:
        anchor (1.0, 0.0)
        pos (0,0)
        linear 1.0 xanchor 0.0
    on hide:
        linear 1.0 ypos 1.0
http://www.renpy.org/doc/html/atl.html# ... -statement

Pyro
Newbie
Posts: 22
Joined: Tue Feb 03, 2015 6:56 am
Tumblr: daily-dragon
Contact:

Re: Screen transition problem

#5 Post by Pyro »

Thanks dude. I am at work right now but I will check it later.
I stumbled across the renpy.notify() built-in function last night and started using that, although I had to do some modifications to the transitions and display to make it look how I wanted. It looks very similar to the stuff you have there. I really should have put two and two together. Ah well.

Thanks a lot!

Pyro
Newbie
Posts: 22
Joined: Tue Feb 03, 2015 6:56 am
Tumblr: daily-dragon
Contact:

Re: Screen transition problem

#6 Post by Pyro »

Just to draw a line under this issue-
I have implemented a system similar to the one you suggested. I have also dropped the multiple screens. I am just using the skillShowBox. I may add multiple screens again later when I want to handle having more than one notification up at once. Something to position additional notes under existing ones or something.

Thanks a lot for your help!

Newprogrammer
Newbie
Posts: 17
Joined: Sat Oct 20, 2018 10:28 am
Contact:

Re: Screen transition problem

#7 Post by Newprogrammer »

Hi guys i need help for two things:
1)how can i create a new topic?
2) i have a problem with the transition, after the first time that i put in the script the hpunch transition the game doesn't recognize the transition anymore. How can i solve it?

Plz be "gentle" with me i'm new...

User avatar
Alex
Lemma-Class Veteran
Posts: 3094
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Screen transition problem

#8 Post by Alex »

1) You need to enter the "Ren'Py Questions and Announcements" forum - the place where all the questions related to coding should be asked (click this name under any topic you'll found or click "Board index" at top left) then there will be "New topic" button.
2) Show the code you've used and spot the place where it doesn't work as you want it.

Post Reply

Who is online

Users browsing this forum: BBN_VN