Blur scene behind choice menu, fade choices in and out.

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
dossy
Newbie
Posts: 1
Joined: Sat Jan 09, 2021 4:50 pm
Github: dossy
itch: dossynj
Contact:

Blur scene behind choice menu, fade choices in and out.

#1 Post by dossy »

A question came up on Discord about how to blur the scene behind the choice menu, and how to fade the menu choices in and out. After much wrangling, I came up with a fairly clean solution, that worked for me on Ren'Py 7.4.0. Hope this helps others who find this in their searches.

https://gist.github.com/dossy/cbb7b7ed1 ... 8d63a15c69

Code: Select all

screen choice(items):
    style_prefix "choice"

    $ renpy.show_layer_at(choice_bg_transform_show, layer='master')
    on "hide" action Function(renpy.show_layer_at, choice_bg_transform_hide, layer='master')

    vbox at choice_transform:
        for i in items:
            textbutton i.caption action i.action

transform choice_bg_transform_show:
    blur 20.0

transform choice_bg_transform_hide:
    blur 0.0

transform choice_transform:
    alpha 0.0
    easein 1.0 alpha 1.0

    on hide:
        easein 1.0 alpha 0.0

Post Reply

Who is online

Users browsing this forum: Alexis_Royce