Are image atlases available in renpy?

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
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.
Post Reply
Message
Author
synedraacus
Regular
Posts: 58
Joined: Tue Jun 09, 2015 8:10 am
Github: synedraacus
Contact:

Are image atlases available in renpy?

#1 Post by synedraacus »

Does renpy have any support for image atlases? Our current project has a lot of little UI elements that are now stored as separate files, and the images directory is clogged. Files like 'images/Button{0}state{1}style{2}.jpg' are all over the place and it'd be nice to tidy up a bit. What I want is to have something like 'Buttons.jpg' and just call them in screen definitions via something like ButtonAtlas.get_segment(xpos, ypos, xsize, ysize) like I can in eg kivy or pretty much every other game engine. If it's relevant, those are not really buttons or scrollbars, but the elements of CDD-based interface, so they are only defined and used in pure Python, not screen language.
If no direct support is available, what Python libraries should I use and what should I do about the distribution? It'd not be great at all to discover that player cannot use the game because they don't have pillow installed on their system.

User avatar
PyTom
Ren'Py Creator
Posts: 16096
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: Are image atlases available in renpy?

#2 Post by PyTom »

Ren'Py automatically atlases imagemaps. We don't have direct support for them otherwise, but you could build something using im.Crop.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

synedraacus
Regular
Posts: 58
Joined: Tue Jun 09, 2015 8:10 am
Github: synedraacus
Contact:

Re: Are image atlases available in renpy?

#3 Post by synedraacus »

Thank you PyTom. I guess I'll work from there.

Post Reply

Who is online

Users browsing this forum: Exabot [Bot]