Page 1 of 1

Screen transition problem

Posted: Sun Apr 26, 2015 10:45 am
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!

Re: Screen transition problem

Posted: Sun Apr 26, 2015 2:57 pm
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)

Re: Screen transition problem

Posted: Sun Apr 26, 2015 7:24 pm
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.

Re: Screen transition problem

Posted: Sun Apr 26, 2015 8:51 pm
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

Re: Screen transition problem

Posted: Mon Apr 27, 2015 9:36 am
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!

Re: Screen transition problem

Posted: Mon Apr 27, 2015 7:53 pm
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!

Re: Screen transition problem

Posted: Sat Oct 20, 2018 12:40 pm
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...

Re: Screen transition problem

Posted: Sat Oct 20, 2018 4:31 pm
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.