You mentioned "sprites", so I'll assume my standard answer of "don't use
show
/
hide
, use
scene
instead" doesn't apply.
What I think you might be aiming towards is RenPy's idea of
You must be registered to see the links
.
Short version: If your displayables (your images) are defined by using names with spaces in them, RenPy will use the first part of the image name as a "tag" and the other parts of the name as "attributes".
So for example
image mary beach night happy = ...
,
mary
is the image tag,
beach
,
night
and
happy
are attributes.
The reason I'm mentioning all of this is that there can only be ONE
mary
image on screen at any given point. Each tag must be unique.
And before you go off and rename all your images to include spaces in the their names... you don't need to (and honestly, it's probably a bad idea to too).
There's an config option called "automatic_images" - which for some reason is no longer documented.
Add these lines into your options.rpy file...
Python:
define config.automatic_images = [' ','_','-','/']
define config.automatic_images_strip = [ 'images' ]
These two lines will mean that filenames with underscores or hyphens, etc will automatically be converted to tag/attribute style names.
For example:
images/mary_beach_night_happy.png
will auto generate a displayable called
mary
,
beach night happy
, without you needing to manually assign it in your code.
What all that then means is that if you name your files like:
images/mysprite_pic01.png
images/mysprite_pic02.png
images/mysprite_pic03.png
You can simply code:
Code:
scene myscene001 with fade
show mysprite pic01 with dissolve
show mysprite pic02 with dissolve
show mysprite pic03 with dissolve
scene myscene002 with dissolve
#etc.
A reminder: Using
scene
will remove all previously shown images added to the scene by using
show
, without the need to
hide
them.
In this case, each
mysprite
will replace the previous one. Generally the first part of the name would be to uniquely identify the sprite. So character names would be common (hence the example
mary
).
You may notice one of the auto-converted characters is "/". This is to allow for folder/directory names to be part of the displayable name/tag/attributes too.
So for example, using...
Python:
define config.automatic_images = [' ','_','-','/']
define config.automatic_images_strip = [ 'images' , 'sprites']
Would mean you could put your files into subfolders like:
images/sprites/mary/beach_night_happy.png
- > mary
beach night happy
images/sprites/mary/beach_day_happy.png
- > mary
beach day happy
images/sprites/mary/school_day_happy.png
- > mary
- school day happy
images/sprites/mary/school_day_sad.png
- > mary
- school day sad