How to create a transition that is like flip/turning a page?

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
AnnieJuraski
Newbie
Posts: 7
Joined: Thu Mar 14, 2024 7:56 pm
Contact:

How to create a transition that is like flip/turning a page?

#1 Post by AnnieJuraski »

I wanna to create a trasition between sscenes that looks like we are turning the page. I found this post on Reddit, but it is now well explained and I have some issues
Link:
https://www.reddit.com/r/RenPy/comments ... _entirely/


My issue is that it only works when I try to use all those properties, like thi:

Code: Select all

scene A2 with flipbook:
			pause 5.5
			xalign 0.0
			ease 0.8 xzoom 0
			pause 5



But the second image/scene/background (scene A2) dissapears after I a time that I use it.

Here the image I've been using:
Attachments
1.png
(626.97 KiB) Not downloaded yet

jeffster
Veteran
Posts: 409
Joined: Wed Feb 03, 2021 9:55 pm
Contact:

Re: How to create a transition that is like flip/turning a page?

#2 Post by jeffster »

Yes, that's how it's supposed to work.

"flipbook" transform dissolves the part of the target image, starting from the pixels that are white in the "overlay" image (or what should I call it), "1.png".
https://renpy.org/doc/html/transitions. ... geDissolve

It is combined with properties

Code: Select all

    xalign 0.0
    ease 0.8 xzoom 0
which scale the target image to zero width, while aligning it to the left. That creates "flipping" the image to the left.

Before that flipping, there's pause 5.5.
After the flipping, there's pause 5.

It's timing that makes the scene transient without user input.

If you want the page to be turned after an interaction, you can do

Code: Select all

    scene A2
    "Now when you click the page will be turned"
    scene A2 with flipbook:
        xalign 0.0
        ease 0.8 xzoom 0
    show A3
PS. Or to reveal image A3, flipping the page:

Code: Select all

label start:
    scene A3
    show A2
    "Now when you click the page will be turned"
    show A2 with flipbook:
        xalign 0.0
        ease 0.8 xzoom 0
    "Ok"
    jump start

AnnieJuraski
Newbie
Posts: 7
Joined: Thu Mar 14, 2024 7:56 pm
Contact:

Re: How to create a transition that is like flip/turning a page?

#3 Post by AnnieJuraski »

jeffster wrote: Fri Mar 15, 2024 3:43 pm Yes, that's how it's supposed to work.

"flipbook" transform dissolves the part of the target image, starting from the pixels that are white in the "overlay" image (or what should I call it), "1.png".
https://renpy.org/doc/html/transitions. ... geDissolve

It is combined with properties

Code: Select all

    xalign 0.0
    ease 0.8 xzoom 0
which scale the target image to zero width, while aligning it to the left. That creates "flipping" the image to the left.

Before that flipping, there's pause 5.5.
After the flipping, there's pause 5.

It's timing that makes the scene transient without user input.

If you want the page to be turned after an interaction, you can do

Code: Select all

    scene A2
    "Now when you click the page will be turned"
    scene A2 with flipbook:
        xalign 0.0
        ease 0.8 xzoom 0
    show A3
PS. Or to reveal image A3, flipping the page:

Code: Select all

label start:
    scene A3
    show A2
    "Now when you click the page will be turned"
    show A2 with flipbook:
        xalign 0.0
        ease 0.8 xzoom 0
    "Ok"
    jump start
Problem is that when the first background changes, it reveals something blank, like a png transparent backgreorund squares

jeffster
Veteran
Posts: 409
Joined: Wed Feb 03, 2021 9:55 pm
Contact:

Re: How to create a transition that is like flip/turning a page?

#4 Post by jeffster »

AnnieJuraski wrote: Tue Mar 19, 2024 10:55 pm Problem is that when the first background changes, it reveals something blank, like a png transparent backgreorund squares
Yes, when there's no picture, then in "developer" mode you see checkered background. When developer mode is off, it will be just black.

When you develop a Ren'Py game, config.developer is originally True:
https://renpy.org/doc/html/config.html# ... .developer
define config.developer = "auto"
If set to True, developer mode is enabled. Developer mode gives access to the shift+D developer menu, shift+R reloading, and various other features that are not intended for end users.
This can be True, False, or "auto". If "auto", Ren'Py will detect if the game has been packaged into a distribution, and set config.developer as appropriate.
So in distribution (or if you explicitly set "config.developer" to False) there will be black background instead of those squares.

Alternatively, you can set additional picture as a background. For example:

Code: Select all

    scene black onlayer bottom
"onlayer bottom" puts it behind usual pictures, so that background remains there even if you clear everything with "scene" statement.


Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], wizard_jpg