Hi, I try to create a visual novel in Ren'Py with animated backgrounds and characters
I made the animations with Adobe After Effects and exported them as .webm - because that's recommended in Ren'Py. But my character should have a transparent background - so you can see the actual background behind - but when I play the game, the background of the character sprite is black.
I read that I need some kind of mask to make it transparent, is that correct? And how do I make such a mask?
Thank you
[Solved] Animated Characters in Ren'Py?
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.
- MonaMouseArt
- Newbie
- Posts: 8
- Joined: Sat Jan 22, 2022 4:41 pm
- Contact:
[Solved] Animated Characters in Ren'Py?
Last edited by MonaMouseArt on Tue Jan 25, 2022 5:49 pm, edited 1 time in total.
- Ocelot
- Lemma-Class Veteran
- Posts: 2407
- Joined: Tue Aug 23, 2016 10:35 am
- Github: MiiNiPaa
- Discord: MiiNiPaa#4384
- Contact:
Re: Animated Characters in Ren'Py?
https://www.renpy.org/doc/html/movie.ht ... ie-sprites
The primary movie provides the color of the sprite. A second movie, the mask movie, provides the alpha channel, with white being full opacity and black being full transparency.
< < insert Rick Cook quote here > >
- MonaMouseArt
- Newbie
- Posts: 8
- Joined: Sat Jan 22, 2022 4:41 pm
- Contact:
Re: Animated Characters in Ren'Py?
Okay, so the mask sprite has to have a white character and a black background?Ocelot wrote: ↑Sat Jan 22, 2022 5:10 pm https://www.renpy.org/doc/html/movie.ht ... ie-spritesThe primary movie provides the color of the sprite. A second movie, the mask movie, provides the alpha channel, with white being full opacity and black being full transparency.
What about the normal movie? Does the background has to be white there?
(And thanks for your answer )
- Ocelot
- Lemma-Class Veteran
- Posts: 2407
- Joined: Tue Aug 23, 2016 10:35 am
- Github: MiiNiPaa
- Discord: MiiNiPaa#4384
- Contact:
Re: Animated Characters in Ren'Py?
Yes, white character and black background. Normal movie does not have to have anything specific for background (in fact, you can use mask to selectively clip things from normal movie).
< < insert Rick Cook quote here > >
- YossarianIII
- Veteran
- Posts: 382
- Joined: Tue Jan 13, 2015 10:26 pm
- Completed: Guns & Lovers; SRRT!; Kill Your Refrigerator; Banality Man; Beretta Mondatta
- Projects: Solidarity Forever
- Organization: KONOL Games
- Contact:
Re: Animated Characters in Ren'Py?
It's kind of a pain, but one other option that might be worth looking into is rendering your animation frame by frame as pngs (or webp) and coding it as an Image Statement With ATL Block: https://www.renpy.org/doc/html/atl.html ... -atl-block
You can combine this with Layered Images or Condition Switch (or both) to make it easier to do expressions and poses (or anything where only a relatively small part of the image changes). In addition to being a little more flexible, I think it usually reduces file size, and as an added bonus, it makes things easier if you ever consider a browser port (since webm currently isn't compatible with Ren'Py's HTML distribution builder).
I actually tried to do a predominately webm-based game for NaNoRenO last year, and while it definitely works, it can get unexpectedly complicated (for example, I found it hard to time things so that an idle animation goes smoothly into a pose animation).
Depending on your goals, webm videos may still be the way to go. I would say it's a good choice for anything relatively high production value (or somewhat long) that isn't going to change a lot based on variables or player input. For something that's short and simple (i.e. lip flap or blinking) or something that's very "game-y" (affected by variables or player input), using transformation language (ATL) is probably the way to go. It might seem complicated, but after the initial learning curve it becomes way easier.
You can combine this with Layered Images or Condition Switch (or both) to make it easier to do expressions and poses (or anything where only a relatively small part of the image changes). In addition to being a little more flexible, I think it usually reduces file size, and as an added bonus, it makes things easier if you ever consider a browser port (since webm currently isn't compatible with Ren'Py's HTML distribution builder).
I actually tried to do a predominately webm-based game for NaNoRenO last year, and while it definitely works, it can get unexpectedly complicated (for example, I found it hard to time things so that an idle animation goes smoothly into a pose animation).
Depending on your goals, webm videos may still be the way to go. I would say it's a good choice for anything relatively high production value (or somewhat long) that isn't going to change a lot based on variables or player input. For something that's short and simple (i.e. lip flap or blinking) or something that's very "game-y" (affected by variables or player input), using transformation language (ATL) is probably the way to go. It might seem complicated, but after the initial learning curve it becomes way easier.
Who is online
Users browsing this forum: henne