Request Image statement

The Insider

Member
Game Developer
May 4, 2017
144
255
Hello! I have this code and I'd be grateful if someone could help me make a statement if an image is displayed.

Example:
if renpy.seen ("map.jpg")
jump labelX




init python:

modImageList = []
directory = renpy.os.path.join( config.gamedir, "images/0.2/", "Random" )
for filename in renpy.os.listdir( directory ):

if not renpy.os.path.isdir( renpy.os.path.join( directory, filename ) ):
modImageList.append( renpy.os.path.join( directory, filename ) )




def showRandomImage(subdir="."):
directory = "/".join([config.gamedir.replace("\\", "/"), "images/0.2/", subdir])
modImageList = [ "/".join([directory, filename])
for filename in renpy.os.listdir(directory)
if filename.endswith((".png"))]
renpy.show("randimg", what=Image(renpy.random.choice(modImageList)))