custom screen alpha blended according to alphamask

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
svatem1
Newbie
Posts: 5
Joined: Thu Sep 29, 2022 1:34 pm
Contact:

custom screen alpha blended according to alphamask

#1 Post by svatem1 »

I defined my custom screen, in which i have some layout/ui structure, it's basically chat-like UI. I'm spawning this screen via show screen myscreen statement. Is there any simple way how to say "hey, here's my picture, take it's alpha channel and mask my screen onto the background according to it"?

Or different question -> in that screen, i have frame defined, can i somehow say "take this frame, apply this alpha channel to it and all of its children recursively"?

thank you in advance

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2400
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: custom screen alpha blended according to alphamask

#2 Post by Ocelot »

All screen elements take at property which allows to apply arbitrary (including immideately-defined) transforms. alpha is a valid transform property.
You cannot apply transform to the screen itself, but you can explicitely create a root fixed element (which usually is created implicitely) and apply that property to it.

Not sure about your first question. I would try to play around with model-based rendering, shaders and different blend modes, maybe creating one yourself...
< < insert Rick Cook quote here > >

svatem1
Newbie
Posts: 5
Joined: Thu Sep 29, 2022 1:34 pm
Contact:

Re: custom screen alpha blended according to alphamask

#3 Post by svatem1 »

Thank you for your response. The first question is basically the same as 2nd, the only difference being -> if I do not want to have constant alpha but some picture with alpha channel instead (to e.g. create gradient), is it possible?

Post Reply

Who is online

Users browsing this forum: No registered users