Transition when showing screen [SOLVED]

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
Milkymalk
Miko-Class Veteran
Posts: 752
Joined: Wed Nov 23, 2011 5:30 pm
Completed: Don't Look (AGS game)
Projects: KANPEKI! ★Perfect Play★
Organization: Crappy White Wings
Location: Germany
Contact:

Transition when showing screen [SOLVED]

#1 Post by Milkymalk » Tue Jun 16, 2015 9:06 pm

Quick and probably stupid question: How do I use a transition when showing a screen?
I tried this:

Code: Select all

on "show" action With(Dissolve(1.0))
but nothing happens at all.

The screen is called from within a python function with

Code: Select all

renpy.call_screen('hackinggrid', self)
so I can't just use "show screen myscreen with dissolve".

Also, How can I make a solid color image with Alpha < 1.0 to use as a background in a screen? By using a fourth "color" element for Alpha, like "#00000080" instead of "#000000". Okay, that was easy.
Last edited by Milkymalk on Thu Jun 18, 2015 12:32 pm, edited 1 time in total.
Crappy White Wings (currently quite inactive)
Working on: KANPEKI!
(On Hold: New Eden, Imperial Sea, Pure Light)

User avatar
nyaatrap
Crawling Chaos
Posts: 1824
Joined: Mon Feb 13, 2012 5:37 am
Location: Kimashi Tower, Japan
Contact:

Re: Transition when showing screen, and non-opaque solids

#2 Post by nyaatrap » Wed Jun 17, 2015 12:27 pm

$renpy.transition(dissolve)
show screen XXX

renpy.transition is a function that internally used as config.menu_transition or others.

User avatar
Milkymalk
Miko-Class Veteran
Posts: 752
Joined: Wed Nov 23, 2011 5:30 pm
Completed: Don't Look (AGS game)
Projects: KANPEKI! ★Perfect Play★
Organization: Crappy White Wings
Location: Germany
Contact:

Re: Transition when showing screen, and non-opaque solids

#3 Post by Milkymalk » Wed Jun 17, 2015 1:30 pm

Tried it;

Code: Select all

            renpy.transition(dissolve)
            self.result = renpy.call_screen('hackinggrid', self)
It made no difference :-(
Crappy White Wings (currently quite inactive)
Working on: KANPEKI!
(On Hold: New Eden, Imperial Sea, Pure Light)

User avatar
nyaatrap
Crawling Chaos
Posts: 1824
Joined: Mon Feb 13, 2012 5:37 am
Location: Kimashi Tower, Japan
Contact:

Re: Transition when showing screen, and non-opaque solids

#4 Post by nyaatrap » Wed Jun 17, 2015 2:00 pm

It should, unless your screen is too heavy to load all screen elements. Or do you want to add pause while showing screens?

User avatar
Milkymalk
Miko-Class Veteran
Posts: 752
Joined: Wed Nov 23, 2011 5:30 pm
Completed: Don't Look (AGS game)
Projects: KANPEKI! ★Perfect Play★
Organization: Crappy White Wings
Location: Germany
Contact:

Re: Transition when showing screen, and non-opaque solids

#5 Post by Milkymalk » Wed Jun 17, 2015 2:39 pm

When the screen is loaded it is almost empty, just a few small images, a fullscreen background and a viewport.

Not sure what you mean with "add pause". I just want to use a transition when the screen appears.
Crappy White Wings (currently quite inactive)
Working on: KANPEKI!
(On Hold: New Eden, Imperial Sea, Pure Light)

User avatar
Milkymalk
Miko-Class Veteran
Posts: 752
Joined: Wed Nov 23, 2011 5:30 pm
Completed: Don't Look (AGS game)
Projects: KANPEKI! ★Perfect Play★
Organization: Crappy White Wings
Location: Germany
Contact:

Re: Transition when showing screen, and non-opaque solids

#6 Post by Milkymalk » Wed Jun 17, 2015 5:18 pm

I don't know why it didn't work before, but now it does. Apparently, the on "show" statement I still had in the screen hindered the renpy.transition() statement from working - if I have both, the transition does not occur.

But something strange is happening. I also added this to my screen:

Code: Select all

    on "hide" action With(Dissolve(1.0))
What it does is not dissolve the screen when the interaction ends, but instead it dissolves the following "say" statement in!

The screen is called via "variable = renpy.call_screen()". Then I leave the interaction by using the "Jump()" screen action from another screen. My guess is that this causes the interaction to end, hiding the screen without causing any transitions. So the "queued" transition from on "hide" is probably used for the next interaction, which is the dialogue window appearing.

I know it's not the most elegant way, but trying to use on "hide" action Return() from the other screen didn't work.

Any ideas how I can use a transition when exiting the interaction? Maybe a different architecture for doing this? Currently I have the second screen jump out of the interaction because I don't know how to do it from the called screen once the second screen closes (on its own, with a timer).
Crappy White Wings (currently quite inactive)
Working on: KANPEKI!
(On Hold: New Eden, Imperial Sea, Pure Light)

User avatar
nyaatrap
Crawling Chaos
Posts: 1824
Joined: Mon Feb 13, 2012 5:37 am
Location: Kimashi Tower, Japan
Contact:

Re: Transition when showing screen, and non-opaque solids

#7 Post by nyaatrap » Wed Jun 17, 2015 9:14 pm

renpy.transition() and renpy.with_statement() is different.
renpy.with_statement is actually a combined statement of transition and pause. If you use

Code: Select all

show X with Tran(1.0)
then it's almost same to

Code: Select all

show X
$renpy.transition(Tran(1.0)) # it queues how to show.
$renpy.pause(1.0) # this line execute transition
screen action With() is actually renpy.transtion(), so it's executed at the next interaction or pause. That's why it behaves like that.

I don't know it'll work or not, but try putting $renpy.pause after hide screens. (Though I think transform works better than transition)

User avatar
Milkymalk
Miko-Class Veteran
Posts: 752
Joined: Wed Nov 23, 2011 5:30 pm
Completed: Don't Look (AGS game)
Projects: KANPEKI! ★Perfect Play★
Organization: Crappy White Wings
Location: Germany
Contact:

Re: Transition when showing screen, and non-opaque solids

#8 Post by Milkymalk » Wed Jun 17, 2015 11:35 pm

But I'm not using the with statement, I'm using the With() screen action which, according to the manual, "causes a transition to occur". Even if it's the "next" transition, it should apply to the hiding and not the say statement. I still think the transitiuon for hiding the screen is just skipped because I literally jumped out of the interaction.

Regardless, I tried putting a pause directly after the screen is hidden, but it doesn't change a thing.

What do you mean with transforms? I don't know how to apply a transform to a screen that is already shown.
Crappy White Wings (currently quite inactive)
Working on: KANPEKI!
(On Hold: New Eden, Imperial Sea, Pure Light)

User avatar
nyaatrap
Crawling Chaos
Posts: 1824
Joined: Mon Feb 13, 2012 5:37 am
Location: Kimashi Tower, Japan
Contact:

Re: Transition when showing screen, and non-opaque solids

#9 Post by nyaatrap » Thu Jun 18, 2015 12:03 am

On hide action is triggered by return, so it can't apply to the old screen already been hidden. You may have to put the action before return, not on hide.
Anyway, transform is easier:

Code: Select all

screen:
    window at show_hide_dissolve

transform show_hide_dissolve:
    on show:
        alpha .0
        linear .5 alpha 1.0
    on hide:
        alpha 1.0
        linear .5 alpha .0
If even transform doesn't work, the problem is somewhere different in your code.

User avatar
Milkymalk
Miko-Class Veteran
Posts: 752
Joined: Wed Nov 23, 2011 5:30 pm
Completed: Don't Look (AGS game)
Projects: KANPEKI! ★Perfect Play★
Organization: Crappy White Wings
Location: Germany
Contact:

Re: Transition when showing screen, and non-opaque solids

#10 Post by Milkymalk » Thu Jun 18, 2015 12:31 pm

Thank you, that finally worked! :D
Crappy White Wings (currently quite inactive)
Working on: KANPEKI!
(On Hold: New Eden, Imperial Sea, Pure Light)

Post Reply

Who is online

Users browsing this forum: _ticlock_