Page 1 of 1

Leafing through the pages of the book

Posted: Thu Mar 14, 2019 2:35 pm
by Andredron
Image

Code: Select all


###by 7dots Ruslan Nebykov
init -1 python:
    # game window in the center of the screen
    import os
    os.environ ['SDL_VIDEO_CENTERED'] = '1'
    # automatic image ads
    config.automatic_images_minimum_components = 1
    config.automatic_images = ['', '_', '/']
    config.automatic_images_strip = ['images']
    style.default.font = "fonts / AnimeAceV3.ttf"
    style.default.size = 22

init:
    # position of the left page
    transform lf ():
        xpos .5 xanchor 1.0 yalign .5
    # position of the right page
    transform rg ():
        xpos .5 xanchor 0.0 yalign .5
    # right to center (scrolling right to center)
    transform r2c (delay = .25):
        xpos .5 xanchor 0.0 xzoom 1.0 yalign .5
        easeout delay xzoom 0.001
    # center to left (scrolling from the center to the left)
    transform c2l (delay = .25):
        xpos .5 xanchor 1.0 xzoom .001 yalign .5
        easein delay xzoom 1.0
init python:
    # flipping
    # first new pages, then old
    # if the page is not specified, it will be empty
    def pflip (new1 = "pageleft", new2 = "pageright", old1 = "pageleft", old2 = "pageright", delay = .5):
        renpy.hide ("pleft")
        renpy.hide ("pright")
        renpy.show (old1, [lf ()], tag = "pleft")
        renpy.show (new2, [rg ()], tag = "pright")
        renpy.show (old2, [r2c (delay * .5)], tag = "plist")
        renpy.pause (delay * .5)
        renpy.show (new1, [c2l (delay * .5)], tag = "plist")
        renpy.pause (delay * .5)
        renpy.show (new1, [lf ()], tag = "pleft")
        renpy.show (new2, [rg ()], tag = "pright")
        renpy.hide ("plist")

label start:
    scene expression "# 445"
    show pagebook with dissolve
    "Now look through the book. Just click on the screen."
    # from blank to title
    $ pflip ("page0", "page1")
    pause
    # title to text
    $ pflip ("page2", "page3", "page0", "page1")
    pause
    # go back to empty pages
    $ pflip (old1 = "page2", old2 = "page3")
    "The remaining pages are empty for some reason."
    # from empty to empty
    $ pflip ()
    "Well, there is no point flipping further."
    # remove pages from the screen and the book itself
    hide pleft
    hide pright
    hide pagebook
    with dissolve
    return
Download http://renpyfordummies.blogspot.com/201 ... t.html?m=1


2) Menu in the form of an animation of a page

Image

Download - http://renpyfordummies.blogspot.com/201 ... 5.html?m=1

Re: Leafing through the pages of the book

Posted: Fri Mar 15, 2019 2:58 am
by isobellesophia
Thank you Andredron!

But is this also use as a book novel? Instead of a default one?

Re: Leafing through the pages of the book

Posted: Fri Mar 15, 2019 4:20 am
by Andredron
isobellesophia wrote: Fri Mar 15, 2019 2:58 am Thank you Andredron!

But is this also use as a book novel? Instead of a default one?
Yes it is true, it will be especially important to look if you are doing a project in the form of a notebook, a children's story. Or a comic book presentation where you buy chapters

Re: Leafing through the pages of the book

Posted: Fri Mar 15, 2019 4:42 am
by isobellesophia
I see, i will try!

Re: Leafing through the pages of the book

Posted: Tue Apr 27, 2021 11:27 am
by paranooo
Love your projects! hello from fellow russian renpy user! always waiting for your new entries!