How to check if a screen is currently shown? [Solved]
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.
How to check if a screen is currently shown? [Solved]
Is there a function to get all the screens currently showing or something?
Last edited by texi on Wed Aug 30, 2017 5:55 pm, edited 1 time in total.
Re: How to check if a screen is currently shown?
For the current screen you could use renpy.get_screen, which returns the current screen:
Code: Select all
if renpy.get_screen("say"):
text "The say screen is showing."
else:
text "The say screen is hidden."
- Remix
- Eileen-Class Veteran
- Posts: 1628
- Joined: Tue May 30, 2017 6:10 am
- Completed: None... yet (as I'm still looking for an artist)
- Projects: An un-named anime based trainer game
- Contact:
Re: How to check if a screen is currently shown?
Not an inbuilt function as far as I know, though you should be able to run one up by looking at the various functions in
renpy-{version}-source/renpy/display/screen.rpy
I'd suggest looking at the definitions around line 732 and maybe the sorting function
# Line 737 ish
def sort_screens():
with
# Line 912 ish
def get_screen(name, layer=None):
# Line 954 ish
def has_screen(name):
get_screen is even documented
renpy-{version}-source/renpy/display/screen.rpy
I'd suggest looking at the definitions around line 732 and maybe the sorting function
# Line 737 ish
def sort_screens():
with
# Line 912 ish
def get_screen(name, layer=None):
# Line 954 ish
def has_screen(name):
get_screen is even documented
Frameworks & Scriptlets:
- Speech Bubble dialogue system
- Multiple Notify with ATL and history
- (WIP) Radial Masking - needs updating to use Shader
- 7.4 - Smooth Tinting using ATL and matrixcolor
- Several other repositories there too
Who is online
Users browsing this forum: Bing [Bot], Google [Bot]