Creating custom transitions using mask image [Solved]
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.
Creating custom transitions using mask image [Solved]
Is it possible to create our own transitions using a mask image? Like a black and white mask image where the white portion of the mask shows the old scene and the black portion shows the new scene. To help visualize what I'm trying to achieve please take a look at the attached images. One is the image mask, and the other is the result of using the mask. Thanks in advance.
Oh, I should add that in this example, I wish to move the mask image from left to right so that the new scene will cover the old scene.
Oh, I should add that in this example, I wish to move the mask image from left to right so that the new scene will cover the old scene.
- Attachments
-
- Transition mask image.
- TransMask.jpg (10.02 KiB) Viewed 2063 times
Last edited by Strum on Sun Nov 13, 2011 4:13 pm, edited 1 time in total.
- Soraminako
- Veteran
- Posts: 277
- Joined: Sun Sep 04, 2011 1:36 am
- Projects: A thingie without a title. With messy code.
- Contact:
Re: Creating custom transitions using mask image
While it is possible to do something like that with the following code, the result is unfortunately nowhere near the gorgeous example you gave.
I'm hoping we can find a better way to do it. I also love transitions with image masks, so I'll try again when I have more time. It would be great if it could be done smoothly and beautifully like in your example image.
Code: Select all
$ customdissolve01 = ImageDissolve(im.Tile("TransMask.jpg"), 2.0, 1) (I drew my avatar especially to express the scary feeling I get from the code as I type it... XD)
Re: Creating custom transitions using mask image
That's a brilliant idea, to dissolve an image starting from the brightest area first. I never thought of doing things that way. After a bit of messing around with some numbers I finally achieved the custom transition I was looking for. Thanks for the help.
- PyTom
- Ren'Py Creator
- Posts: 15893
- 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: Creating custom transitions using mask image [Solved]
Playing with the ramplen parameter to ImageDissolve will help smooth out the rough dissolves.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom
- Soraminako
- Veteran
- Posts: 277
- Joined: Sun Sep 04, 2011 1:36 am
- Projects: A thingie without a title. With messy code.
- Contact:
Re: Creating custom transitions using mask image [Solved]
Uhm, if either of you could share the code to get such things smooth, I'd be so glad to have it too. ;___;
Like I said, I love such transitions, have been trying to do it for a while, and don't know how to do it quite right.
So uhm, please share that knowledge so the rest of us forum dwellers can do it too? ^^;
Like I said, I love such transitions, have been trying to do it for a while, and don't know how to do it quite right.
(I drew my avatar especially to express the scary feeling I get from the code as I type it... XD)
- PyTom
- Ren'Py Creator
- Posts: 15893
- 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: Creating custom transitions using mask image [Solved]
Instead of 1, make the last parameter (the ramplen parameter) a larger number. Valid values are the powers of 2 less than or equal to 256: 1, 2, 4, 8, 16, 32, 64, 128, and 256.
In the example above, it looks like the overlap might be a quarter of the screen. So try 64.
In the example above, it looks like the overlap might be a quarter of the screen. So try 64.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom
- Soraminako
- Veteran
- Posts: 277
- Joined: Sun Sep 04, 2011 1:36 am
- Projects: A thingie without a title. With messy code.
- Contact:
Re: Creating custom transitions using mask image [Solved]
Thank you so much! It works indeed perfectly now! 
(I drew my avatar especially to express the scary feeling I get from the code as I type it... XD)
Who is online
Users browsing this forum: Bing [Bot], Google [Bot]

