Creating a "shadow" on top of the images that use "show"

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
User avatar
henne
Newbie
Posts: 17
Joined: Tue May 25, 2021 6:10 am
Contact:

Creating a "shadow" on top of the images that use "show"

#1 Post by henne »

Hello there,

I use AlphaMask to drop a shadow (a slowy moving image) on top of my images whenever they are in certain places and so on.

Code: Select all

    scene forest
    show mann
    show expression AlphaMask("forestshadow", At("mann", center)) as mask
    with dissolve
This is working just fine, however as soon as I have multiple images, that use that expression, my poor laptop is slowing down.

Code: Select all

    scene forest
    show mann
    show expression AlphaMask("forestshadow", At("mann", center)) as mask
    show person2 at right
    show expression AlphaMask("forestshadow", At("person2", right)) as mask2
    with dissolve

So, I was wondering if there is a better way to get this effect without using it n times at the same time. If I could just use one it one time but on every image that I want to?

I was thinking about something like "show layer master at ..." but that would also show the effect on the background image and that is not what I want.

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

Re: Creating a "shadow" on top of the images that use "show"

#2 Post by Ocelot »

henne wrote: Thu Jun 10, 2021 5:07 am I was thinking about something like "show layer master at ..." but that would also show the effect on the background image and that is not what I want.
If that is the only problem you have with this approach, have you thought of displaying images which need shadows and those who doesn't on different layers?
< < insert Rick Cook quote here > >

User avatar
henne
Newbie
Posts: 17
Joined: Tue May 25, 2021 6:10 am
Contact:

Re: Creating a "shadow" on top of the images that use "show"

#3 Post by henne »

Ocelot wrote: Thu Jun 10, 2021 5:21 am have you thought of displaying images which need shadows and those who doesn't on different layers?
Reading this - I really have to say: "No, I did not think of this."

My brain can be pretty stupid at times, thanks :)
I guess, I have to test if that does what I wish to do, but that could be it.

User avatar
henne
Newbie
Posts: 17
Joined: Tue May 25, 2021 6:10 am
Contact:

Re: Creating a "shadow" on top of the images that use "show"

#4 Post by henne »

Returning home and taking a look at it, something is not working as it should.

Code: Select all

transform forestshadow_still:
    "images/bg/waldschatten1.png"


label start:

    scene forest
    show eileen happy
    show layer master at forestshadow_still
    with dissolve

    e "You've created a new Ren'Py game."
I can see the effect for a split second with nothing else there (the time of the dissolve, I guess) and then everything looks like it was never there. I use the normal master-layer in this case because I was just testing it, thought maybe it would just not work in my game, so I started a new one as a test.


If I write it as

Code: Select all

show eileen happy at forestshadow_still 
she cannot be seen at all but at least the effect does not vanish.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot], trailsiderice