Layering images
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.
Layering images
Does renpy support layering of images, that is to compose an image by layering multiple images on top of each other?
- 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:
Yes. Just show multiple images.
The pictures are shown with the newest on top. You can only have one picture with a given prefix (first part of the name) on screen at once, and showing a second picture with the same prefix places the new picture at the same point in the order as the old one.
So if I do a:
Lucy will still be on top of her. Hope this helps.
Code: Select all
scene whitehouse
show eileen happy
show lucy happy
So if I do a:
Code: Select all
show eileen upset
- 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:
Oh.
The answer to that question is "not really". I'm sure one could do it with enough careful programming, but Ren'Py doesn't make it easy. I didn't see much of a need, as computer nowadays have enough ram and disk space to make this not worth the added complexity.
This is the same reason why I don't support color-keyed images, but instead only support formats with actual alpha channels, like PNG.
The answer to that question is "not really". I'm sure one could do it with enough careful programming, but Ren'Py doesn't make it easy. I didn't see much of a need, as computer nowadays have enough ram and disk space to make this not worth the added complexity.
This is the same reason why I don't support color-keyed images, but instead only support formats with actual alpha channels, like PNG.
Opps sorry, I guess I should've explained in more detail. Yeah, I meant to do what Tage is saying. But I just wanted to know if I could just slap layers of images on top of each other in general cause there might be other uses for that too. I didn't specifically say color-keying, but if the use of transparent PNGs on top of each other achieves the same effect, then thats fine.
People may have plentiful disk space around, but they may not have high speed modems though. I personally like to keep files small and save whenever I can.
People may have plentiful disk space around, but they may not have high speed modems though. I personally like to keep files small and save whenever I can.
- rioka
- Royal Manga Tutor
- Posts: 1255
- Joined: Fri Jul 16, 2004 12:21 pm
- Completed: Amgine Park, Garden Society: Kykuit, Metropolitan Blues (art)
- Location: somewhere in NY
- Contact:
Actually, RenPy can do what RedSlash wants to accomplish. The Love Revo system is based on a paperdoll method and it works fine on RenPy. (We're currently putting together the demo's on RenPy as our own engine is not finished.)
It saves a lot of space doing it the paperdoll method. Consider this: you have 4 expressions: neutral, happy, mad, sad. If it was the complete person, it could run about say 15KB per image. Total: 60KB. Now, take that and add in all the different outfits (let's say 4), it runs to 240KB.
Now, if you do the paperdoll method, you get 12KB for the body base, around the same for the each clothing at 12KB each, totaling 60KB. Each expression is about 8 KB, let's say. Grand total = 92KB.
It may not seem a lot but once you make something with a lot of characters or have high quality character images - it helps a lot.
It saves a lot of space doing it the paperdoll method. Consider this: you have 4 expressions: neutral, happy, mad, sad. If it was the complete person, it could run about say 15KB per image. Total: 60KB. Now, take that and add in all the different outfits (let's say 4), it runs to 240KB.
Now, if you do the paperdoll method, you get 12KB for the body base, around the same for the each clothing at 12KB each, totaling 60KB. Each expression is about 8 KB, let's say. Grand total = 92KB.
It may not seem a lot but once you make something with a lot of characters or have high quality character images - it helps a lot.
- 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:
Well, I'm convinced. I just added layer support to the latest version of Ren'Py. Basically, if you create an image using a constructor like:
Ren'Py 4.4 will now layer the images together. What's more, it will precompute the merged image, which should speed up performance over the layered approach.
I didn't know Love Revo was using Ren'Py, at least for a demo.
And in other news, dentistry is significantly less fun when the Novicane just doesn't work on you.
Code: Select all
init:
image eileen happy beret = Image(("9a_happy.png", "beret.png"))
I didn't know Love Revo was using Ren'Py, at least for a demo.
And in other news, dentistry is significantly less fun when the Novicane just doesn't work on you.
- 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:
Not as of right now. The images are aligned to the upper-left corner of the base image. Since transparent areas compress really well, I think that this is an acceptible compromise that also keeps the feature fairly easy to use. (The idea is that the various paper doll parts will be the same size as the character, and so will align to the right spot without the user needing to get into pixel-by-pixel positioning.)
- rioka
- Royal Manga Tutor
- Posts: 1255
- Joined: Fri Jul 16, 2004 12:21 pm
- Completed: Amgine Park, Garden Society: Kykuit, Metropolitan Blues (art)
- Location: somewhere in NY
- Contact:
Wow, thanks PyTom! That'll make things a whole lot easier. ^_^
We just decided on using RenPy fairly recently for Love Revo as both demo's have been coming along lately.
We just decided on using RenPy fairly recently for Love Revo as both demo's have been coming along lately.
Yup, that's what we're basically doing. All the expression's look like floating heads if viewed on their own. XDPyTom wrote:(The idea is that the various paper doll parts will be the same size as the character, and so will align to the right spot without the user needing to get into pixel-by-pixel positioning.)
-
- Newbie
- Posts: 20
- Joined: Sun Jul 06, 2014 8:11 am
- Contact:
Re: Layering images
Can I....
Say have a background layer on a layeredimage:
then position layered attributes and groups within the layer, where I want different characters to appear?
But not use images separately:
Like this?
layeredimage schoolfront:
always:
"images/bg/schoolfront.png"
if coach:
"images/teachers/coach/[face]_[arms]_base.png":
pos(800,250)
would this work?
Say have a background layer on a layeredimage:
then position layered attributes and groups within the layer, where I want different characters to appear?
But not use images separately:
Like this?
layeredimage schoolfront:
always:
"images/bg/schoolfront.png"
if coach:
"images/teachers/coach/[face]_[arms]_base.png":
pos(800,250)
would this work?
Who is online
Users browsing this forum: Bing [Bot], Majestic-12 [Bot]