Skip to content

Instantly share code, notes, and snippets.

@dossy
Last active April 10, 2024 23:51
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dossy/cbb7b7ed18a292e4d9c51c8d63a15c69 to your computer and use it in GitHub Desktop.
Save dossy/cbb7b7ed18a292e4d9c51c8d63a15c69 to your computer and use it in GitHub Desktop.
Ren'Py: Blur scene behind choice menu, fade choices in and out.

How to apply transitions to the current scene behind a Ren'Py choice menu

Here is example code to apply the blur transform to the master layer when a choice menu is displayed, along with applying a fade-in and fade-out effect of the choice items.

This was tested on Ren'Py 7.4.0.1167.

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
@SlayerA259
Copy link

I tried this code
[code]
I'm sorry, but errors were detected in your script. Please correct the
errors listed below, and try again.

File "game/screens.rpy", line 221: u'choice_bg_transform_show' is not a keyword argument or valid child for the transform statement.
transform choice_bg_transform_show:
^

Ren'Py Version: Ren'Py 7.3.5.606
Sun Feb 14 10:42:10 2021
[/code]

Any Idea why I am getting this error?

@dossy
Copy link
Author

dossy commented Feb 14, 2021

Any Idea why I am getting this error?

@SlayerA259, could be a number of things - not really possible to say without seeing your actual code. Could also be that this requires Ren'Py 7.4, and you're still on 7.3.

@SlayerA259
Copy link

@dossy Is there anything else to change except in screen.rpy

@dossy
Copy link
Author

dossy commented Feb 14, 2021

@SlayerA259 No, only screen.rpy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment