Page 1 of 1

is there anyway to get the name of image which scene shown?

Posted: Tue Nov 22, 2022 11:03 pm
by Li yuanlin
I'd like to add that with blur effect in screen game_menu to replace game_menu.png

Re: is there anyway to get the name of image which scene shown?

Posted: Wed Nov 23, 2022 12:44 pm
by _ticlock_
Li yuanlin wrote: Tue Nov 22, 2022 11:03 pm I'd like to add that with blur effect in screen game_menu to replace game_menu.png
renpy.get_showing_tags() to get list of shown images

1) If you want to show all displayable (on layer 'master') with blur when you open game_menu, you can do the following:

Code: Select all

transform blur_on_show:
    linear 1.0 blur 20.0

transform clear_on_hide:
    blur 20.0
    linear 1.0 blur 0.0

screen game_menu(title, scroll=None, yinitial=0.0):

    style_prefix "game_menu"
    on "show" action Function(renpy.show_layer_at, blur_on_show, layer='master')
    on "hide" action Function(renpy.show_layer_at, clear_on_hide, layer='master')
Don't forget to remove the background from game_menu.

2) If you want to show only scene image with blur and "hide" other you can use renpy.get_showing_tags:
for example something like this:

Code: Select all

init python:
    def get_scene_image():
        return renpy.get_showing_tags(sort=True)[0]

screen game_menu(title, scroll=None, yinitial=0.0):

    style_prefix "game_menu"
    on "show" action [
        Function(renpy.change_zorder, 'master', get_scene_image(), 100),
        Function(renpy.show, get_scene_image(), [blur_on_show], layer='master')
        ]

Re: is there anyway to get the name of image which scene shown?

Posted: Thu Nov 24, 2022 10:22 am
by Li yuanlin
_ticlock_ wrote: Wed Nov 23, 2022 12:44 pm
Li yuanlin wrote: Tue Nov 22, 2022 11:03 pm I'd like to add that with blur effect in screen game_menu to replace game_menu.png
renpy.get_showing_tags() to get list of shown images

1) If you want to show all displayable (on layer 'master') with blur when you open game_menu, you can do the following:

Code: Select all

transform blur_on_show:
    linear 1.0 blur 20.0

transform clear_on_hide:
    blur 20.0
    linear 1.0 blur 0.0

screen game_menu(title, scroll=None, yinitial=0.0):

    style_prefix "game_menu"
    on "show" action Function(renpy.show_layer_at, blur_on_show, layer='master')
    on "hide" action Function(renpy.show_layer_at, clear_on_hide, layer='master')
Don't forget to remove the background from game_menu.

2) If you want to show only scene image with blur and "hide" other you can use renpy.get_showing_tags:
for example something like this:

Code: Select all

init python:
    def get_scene_image():
        return renpy.get_showing_tags(sort=True)[0]

screen game_menu(title, scroll=None, yinitial=0.0):

    style_prefix "game_menu"
    on "show" action [
        Function(renpy.change_zorder, 'master', get_scene_image(), 100),
        Function(renpy.show, get_scene_image(), [blur_on_show], layer='master')
        ]
Great!Thank you!