is there anyway to get the name of image which scene shown?
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.
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.
- Li yuanlin
- Regular
- Posts: 92
- Joined: Sat Aug 04, 2018 8:42 pm
- Location: Hong Kong
- Contact:
is there anyway to get the name of image which scene shown?
I'd like to add that with blur effect in screen game_menu to replace game_menu.png
stay hungry,stay foolish.
Re: is there anyway to get the name of image which scene shown?
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
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')
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')
]
- Li yuanlin
- Regular
- Posts: 92
- 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?
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') ]
stay hungry,stay foolish.
Who is online
Users browsing this forum: snotwurm