Sprite opacity issues

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
edgebug
Regular
Posts: 41
Joined: Thu Jun 30, 2016 11:44 pm
Contact:

Sprite opacity issues

#1 Post by edgebug »

Hi there!

I have a character who is only semi-corporeal, so I need to be able to control the opacity of their sprites on the fly. I've tried using ATL to apply different opacities, but it doesn't seem to work at all.

Here's what I've got--I tried to make a transform that will have them show up at half opacity:

Code: Select all

transform nellfade:
    on show:
        alpha 0.0
        linear 1.0 alpha 0.5
    on hide:
        linear 1.0 alpha 0.0
but when I use it in the script, a la:

Code: Select all

show nell shocked at nellfade, center
or

Code: Select all

show nell shocked at center with nellfade
it doesn't work at all and they just show up at full opacity and with no dissolve at all. I've got no idea what's happening--can anyone help me out? How do I change sprite opacity?

Thank you in advance!

EDIT, new info:

I've tried the following:

Code: Select all

show nell shocked at center:
        alpha .5
and the sprite doesn't show up at all, instead of showing up at 50% opacity.

EDIT 2:

It works if it's simply

Code: Select all

show nell shocked:
        alpha .5
but the issue is that I CANNOT add things to the image like "at center" or "with dissolve" or the sprite just disappears.

What the heck is going on?

philat
Eileen-Class Veteran
Posts: 1900
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: Sprite opacity issues

#2 Post by philat »

I have no idea what you're doing, but show image at nellfade, center should work perfectly fine and does so for me in a clean project.

edgebug
Regular
Posts: 41
Joined: Thu Jun 30, 2016 11:44 pm
Contact:

Re: Sprite opacity issues

#3 Post by edgebug »

...It's working now and I have no idea why. All I did was change the transform to this:

Code: Select all

transform nellfade:
 
   alpha 0.0
   linear 1.0 alpha 0.5 
and now it works fine. Oh well--at least it works. :) Thanks!

Post Reply

Who is online

Users browsing this forum: No registered users