Weirdness with LayeredImage when at less than 1.0 opacity

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
BunnyInfernal
Newbie
Posts: 11
Joined: Wed Dec 26, 2018 10:45 am
Contact:

Weirdness with LayeredImage when at less than 1.0 opacity

#1 Post by BunnyInfernal » Sun Nov 17, 2019 6:48 pm

I'm coming across some unexpected behavior with LayeredImage that I'm not sure how to handle. I want to be able to use a Layered Image at varying opacity levels (this is basically being used to apply a tan effect on a customizable character).

The problem I'm running into, is that the different layers aren't showing up at the same opacity.

Here's a quick sample. The LayeredImage itself:

Code: Select all

layeredimage mirror_face_1_tan makeup:
    #Base:
    if pc_lip_size_class == 3:
        "lips3t"
    elif pc_lip_size_class == 2:
        "lips2t"
    else:
        "lips1t"

    ## Tan Makeup
    if pc_makeup and pc_lip_size_class == 3:
        "make_3t"
    elif pc_makeup and pc_lip_size_class == 2:
        "make_2t"
    elif pc_makeup:
        "make_1t"
    else:
        "empty"
This is the code displaying the image, and switching the variable that calls for a different layer.

Code: Select all

$ pc_makeup = False

    show mirror_face_1_tan makeup at wincenter2:
        alpha 0.5
    with dissolve

    "Click to add make-up."

    $ pc_makeup = True

    "Done."
I've gotten the same outcome even if I hide the image and show it again. The layers don't share the same opacity level. Samples of the display before changing the pc_makeup variable and after:

Image
Image

Anyone know why this is happening and how I can get the behavior I want out of this? Thanks!

Hiddenwall
Regular
Posts: 26
Joined: Sun May 14, 2017 6:57 pm
Contact:

Re: Weirdness with LayeredImage when at less than 1.0 opacity

#2 Post by Hiddenwall » Tue Nov 19, 2019 9:52 pm

I've had this same issue recently as well and had to scrap it because of this very same issue. I never tested this method out but I wonder if you put it as an init -1 if that might change anything. Though I know next to nothing about programming.

Post Reply

Who is online

Users browsing this forum: No registered users