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

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
User avatar
Li yuanlin
Regular
Posts: 83
Joined: Sat Aug 04, 2018 8:42 pm
Location: Hong Kong
Contact:

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

#1 Post by Li yuanlin »

I'd like to add that with blur effect in screen game_menu to replace game_menu.png
stay hungry,stay foolish.

User avatar
_ticlock_
Miko-Class Veteran
Posts: 910
Joined: Mon Oct 26, 2020 5:41 pm
Contact:

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

#2 Post 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')
        ]

User avatar
Li yuanlin
Regular
Posts: 83
Joined: Sat Aug 04, 2018 8:42 pm
Location: Hong Kong
Contact:

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

#3 Post 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!
stay hungry,stay foolish.

Post Reply

Who is online

Users browsing this forum: No registered users