is there anyway to get the name of image which scene shown?
Posted: 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
Supporting creators of visual novels and story-based games since 2003.
https://lemmasoft.renai.us/forums/
renpy.get_showing_tags() to get list of shown imagesLi 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
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')
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!_ticlock_ wrote: ↑Wed Nov 23, 2022 12:44 pmrenpy.get_showing_tags() to get list of shown imagesLi 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
1) If you want to show all displayable (on layer 'master') with blur when you open game_menu, you can do the following:Don't forget to remove the background from game_menu.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')
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') ]