how do I make blending modes work?

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
camzgr8game
Newbie
Posts: 12
Joined: Fri Sep 16, 2022 9:32 pm
Contact:

how do I make blending modes work?

#1 Post by camzgr8game »

Hi all, I have a composite image that needs to use the add blending mode like in photoshop/after effects ect, I saw in the docs that there are blending modes, but I have no idea how to implement them, has anyone done it before?

Code: Select all

image powerplantbg = Composite(
    (3840, 2160),
    (0, 0), ConditionSwitch(
        "powerlevel==1", "images/bg/power/powerplantlv1.png",
        "powerlevel==2", "images/bg/power/powerplantlv2.png"
        ),
    (0, 0), "images/bg/power/electrictest.png" 
    )
So right now it works with with the regular composite, but I want to make the electrictest.png use the ADD blend mode,

Here is the docs page. I just can't figure out how to fit it into this image statement.https://www.renpy.org/doc/html/model.ht ... blend_func

Appreciate the help :)

User avatar
PyTom
Ren'Py Creator
Posts: 16088
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: how do I make blending modes work?

#2 Post by PyTom »

You probably don't want to do that, instead use Transform with additive set to 1.0:

Code: Select all

image powerplantbg = Composite(
    (3840, 2160),
    (0, 0), Transform(ConditionSwitch(
        "powerlevel==1", "images/bg/power/powerplantlv1.png",
        "powerlevel==2", "images/bg/power/powerplantlv2.png"
        ), additive=1.0),
    (0, 0), "images/bg/power/electrictest.png" 
    )
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

camzgr8game
Newbie
Posts: 12
Joined: Fri Sep 16, 2022 9:32 pm
Contact:

Re: how do I make blending modes work?

#3 Post by camzgr8game »

Thanks Tom, That works great :)
I appreciate the help

Post Reply

Who is online

Users browsing this forum: Ocelot, Semrush [Bot]