screen update transitions in 6.18 [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
saguaro
Miko-Class Veteran
Posts: 560
Joined: Sun Feb 12, 2012 9:17 am
Completed: Locked-In, Sunrise, The Censor
Organization: Lucky Special Games
itch: saguarofoo
Location: USA
Contact:

screen update transitions in 6.18 [solved]

#1 Post by saguaro »

per the changelog for the upcoming 6.18 release:
Ren'Py has been changed to make a copy of the screens being displayed before a transition occurs. This makes it possible to use a transition to show screen updates. For example, one could increase the value displayed by a bar, and then use the dissolve transition to dissolve in the new segment of bar.
How does one accomplish this? I have a bar that is decremented by a function, and I can either show the screen again (and see the zoom transform on replace) or I can leave the screen up and see the animated value decrease, but I'm not sure how to get both effects at the same time or if I can.

Code: Select all

screen heart_meter:
    tag h
    frame:
        background None xalign 0.5 yalign 0.0
        at quick_zoom
        fixed:
            bar:
                value AnimatedValue (current_heart, range=10) left_bar "images/gui/heart-meter-full.png" right_bar "images/gui/heart-meter-empty.png" xmaximum 150 ymaximum 51 xalign 0.5 thumb None    

...
init python:
    def heartbeat(value):
        global current_heart
        current_heart += value
        renpy.show_screen("heart_meter")
Last edited by saguaro on Sat Aug 30, 2014 10:09 am, edited 1 time in total.

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: screen update transitions in 6.18

#2 Post by PyTom »

Screen transitions are done with the With action, or else the with statement.

Code: Select all


init python:
     $ value = 0

screen test:
    vbox:
        text "[value]"
        textbutton "Increase" action [ SetVariable("value", value + 10), With(dissolve) ]

Code: Select all

show screen test

"Before."
$value += 10
with dissolve
"After."
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: screen update transitions in 6.18

#3 Post by PyTom »

Screen transitions are done with the With action, or else the with statement.

Code: Select all


init python:
     $ value = 0

screen test:
    vbox:
        text "[value]"
        textbutton "Increase" action [ SetVariable("value", value + 10), With(dissolve) ]

Code: Select all

show screen test

"Before."
$value += 10
with dissolve
"After."
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

User avatar
saguaro
Miko-Class Veteran
Posts: 560
Joined: Sun Feb 12, 2012 9:17 am
Completed: Locked-In, Sunrise, The Censor
Organization: Lucky Special Games
itch: saguarofoo
Location: USA
Contact:

Re: screen update transitions in 6.18

#4 Post by saguaro »

Thanks PyTom, I appreciate you.

Post Reply

Who is online

Users browsing this forum: No registered users