image layer above the characters, and below the text?

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
Silphy
Newbie
Posts: 23
Joined: Sun Jan 23, 2011 3:09 am
Contact:

image layer above the characters, and below the text?

#1 Post by Silphy »

is there a way to put an image above the characters layer, but below the text box layer?

I want to make a scene in the forest, where it looks like the characters are standing in the shade under the leaves, with some light shinning through on them, if i could put a .png image in front of them, that was black with a low opacity, and a few "holes" in it, i think it could end up looking nice.

sorry if this is a stupid question, any help would be appreciated.

User avatar
SusanTheCat
Miko-Class Veteran
Posts: 952
Joined: Mon Dec 13, 2010 9:30 am
Location: New Brunswick, Canada
Contact:

Re: image layer above the characters, and below the text?

#2 Post by SusanTheCat »

I haven't done this, but this should help:
http://www.renpy.org/wiki/renpy/doc/tut ... ing_images

Code: Select all

scene bg forest
show myChar
show leavesOverlay
If you get it working, take a screenshot for me. It sounds like a sweet effect.

Susan
" It's not at all important to get it right the first time. It's vitally important to get it right the last time. "
— Andrew Hunt and David Thomas

Silphy
Newbie
Posts: 23
Joined: Sun Jan 23, 2011 3:09 am
Contact:

Re: image layer above the characters, and below the text?

#3 Post by Silphy »

So I re-worked the "static" effect from the cookbook, to make this simple leaf effect, it ended up looking pretty good, although the images i used as overlays need some work...

Code: Select all

    image leaf = anim.SMAnimation("a",
        anim.State("a", "leaf1.png"),
        anim.State("b", "leaf2.png"),
        anim.State("c", "leaf3.png"),
        anim.State("d", "leaf4.png"),
        
        anim.Edge("a", 1.0, "b", trans=Dissolve(1.0, alpha=True)),
        anim.Edge("b", 1.0, "c", trans=Dissolve(1.0, alpha=True)),
        anim.Edge("c", 1.0, "d", trans=Dissolve(1.0, alpha=True)),
        anim.Edge("d", 1.0, "a", trans=Dissolve(1.0, alpha=True)),
        )   
This will probably work the best with a bright park/Forrest background, if the background is dark already then the black opacity 50% overlay will make it REALLY dark (of course you can always reduce the opacity, but then the effect doesnt stand out)

then just placing "show leaf" ontop of the characters makes it work perfectly.
I might change all the times from 1.0 to 2.0 as well to make it a bit more slow...

anyways, give it a shot to see what it looks like, the "leaf" images attached to this post are free for anyone to use as well.
Attachments
leaf4.png
leaf3.png
leaf2.png
leaf1.png

User avatar
PyTom
Ren'Py Creator
Posts: 16096
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: image layer above the characters, and below the text?

#4 Post by PyTom »

You can write that code a bit more easily with ATL:

Code: Select all

image leaf:
    "leaf1.png"
    "leaf2.png" with Dissolve(1.0), pause 1.0
    "leaf3.png" with Dissolve(1.0), pause 1.0
    "leaf4.png" with Dissolve(1.0), pause 1.0
    "leaf1.png" with Dissolve(1.0), pause 1.0
     repeat
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

Silphy
Newbie
Posts: 23
Joined: Sun Jan 23, 2011 3:09 am
Contact:

Re: image layer above the characters, and below the text?

#5 Post by Silphy »

Thank you, to be honest i was having a lot of trouble making an animation, I'm not experienced with this system at all yet, and searching for "Animate" and "animation" in the wiki didnt really help out much.

I made some nicer leaf shadow images, in case anyone is interested.
Attachments
leaf44.png
leaf33.png
leaf22.png
leaf11.png

Post Reply

Who is online

Users browsing this forum: Google [Bot], Ocelot