Possible to get a list of images currently shown on screen?
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.
Possible to get a list of images currently shown on screen?
So I have an idea for a cellphone interface where the game shows a cellphone in the foreground and blurs the background image.
I realize I could create a screen, where I pass it the name of the current game background and do something with im.Blur().
But I had it in my head to make it more generic than that and have the screen "figure out" the current image background based on some mythical, yet unknown to me, list of active images.
The closest I can find at first glance is some combination of renpy.list_images() and renpy.showing(). But since one is a list of images and the other deals with displayable tags - I'm both not hopeful and somewhat concerned that looping through a list of ALL images looking for the showing ones might be too slow.
Can anyone point me in the direction of an alternate solution?
Ideally an image function that has a list of currently shown images.
I'm figuring with a list of current images, I could work out the image dimensions and hopefully only find a single image which is a full screen image (i.e. the current background).
I know the "pass the image name to the screen" is a simpler solution. But it'll bug me if I don't at least try to work through this more generic solution.
In all likelihood, there will be other problems that will make it impractical... but I had to ask.
Cheers in advance for any help offered.
I realize I could create a screen, where I pass it the name of the current game background and do something with im.Blur().
But I had it in my head to make it more generic than that and have the screen "figure out" the current image background based on some mythical, yet unknown to me, list of active images.
The closest I can find at first glance is some combination of renpy.list_images() and renpy.showing(). But since one is a list of images and the other deals with displayable tags - I'm both not hopeful and somewhat concerned that looping through a list of ALL images looking for the showing ones might be too slow.
Can anyone point me in the direction of an alternate solution?
Ideally an image function that has a list of currently shown images.
I'm figuring with a list of current images, I could work out the image dimensions and hopefully only find a single image which is a full screen image (i.e. the current background).
I know the "pass the image name to the screen" is a simpler solution. But it'll bug me if I don't at least try to work through this more generic solution.
In all likelihood, there will be other problems that will make it impractical... but I had to ask.
Cheers in advance for any help offered.
- Angelo Seraphim
- Regular
- Posts: 32
- Joined: Tue May 21, 2019 8:00 am
- Completed: Enamored Risks (NaNoReNo 2020)
- Projects: 616 Charagma
- Organization: GLSUoA
- Deviantart: glsuoa
- itch: glsuoa
- Location: London, UK
- Discord: Just A Concept#9599
- Contact:
Re: Possible to get a list of images currently shown on screen?
Hi @Woetoo
I think this only might be what you are looking for - https://www.renpy.org/doc/html/displayi ... ist_images
It states;
Not sure if there's anything else, but I hope this helps.
I think this only might be what you are looking for - https://www.renpy.org/doc/html/displayi ... ist_images
It states;
I believe on that same page there are functions where you can get the dimensions of an image and so on.Returns a list of images that have been added to Ren'Py, as a list of strings with spaces between the name components.
Not sure if there's anything else, but I hope this helps.
- PyTom
- Ren'Py Creator
- Posts: 15893
- Joined: Mon Feb 02, 2004 10:58 am
- Completed: Moonlight Walks
- Projects: Ren'Py
- IRC Nick: renpytom
- Github: renpytom
- itch: renpytom
- Location: Kings Park, NY
- Contact:
Re: Possible to get a list of images currently shown on screen?
What you probably want to do, in 7.4.1, is to use a blur transform. The setup:
Then something like:
Code: Select all
define config.gl2 = True
transform blur:
blur 8
Code: Select all
show layer master at blur
call screen cellphone
show layer master
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom
Re: Possible to get a list of images currently shown on screen?
You can also add the transform directly to the screen cellphone like this:
In this case, screen cellphone have linear blur transform when the screen is shown(called) and linear blur transform back to the normal background when the screen is hidden(returned from call statement).
If you want instantaneous transition you can remove linear 0.5
Code: Select all
define config.gl2 = True
screen cellphone:
on "show" action Function(renpy.show_layer_at, linear_blur(0,8), layer='master')
on "hide" action Function(renpy.show_layer_at, linear_blur(8,0), layer='master')
...
transform linear_blur(start,end):
blur start
linear 0.5 blur end
If you want instantaneous transition you can remove linear 0.5
Re: Possible to get a list of images currently shown on screen?
Cheers all.
I'm not seeing how each will work yet, but I can have a play. Ta.
But since it'll bug me if I don't ask... is it possible to get the list of currently displayed images?
I'm not seeing how each will work yet, but I can have a play. Ta.
But since it'll bug me if I don't ask... is it possible to get the list of currently displayed images?
Who is online
Users browsing this forum: Bing [Bot]
