How do I change Alpha of an Sprite while running?

Get help using Construct 2

Post » Tue Apr 29, 2014 7:42 pm

Hi!
I would like to change an Sprite Alpha channel while the game is being played. How can I do that?

The main idea is to have a dark blue sprite on top of the background. This blue sprite would start with Alpha set to 0. As the time goes by, the Alpha would be increased to create the feeling of getting late in the night.

Looked for some Image Effect but they don't seemd to be what I am looking for.

Any ideas?

Thanks!
B
24
S
4
G
1
Posts: 177
Reputation: 1,827

Post » Tue Apr 29, 2014 7:52 pm

Alpha = Transparency = Opacity

Just change opacity of an object with time. Or simply use Fade behavior.
ImageImageImageImage
B
157
S
66
G
42
Posts: 2,603
Reputation: 35,343

Post » Tue Apr 29, 2014 8:13 pm

Shinkan,

Opacity did the trick! There are so many things to learn and so many ways to do something with Constructor 2!
It is awesome!

Thanks!
B
24
S
4
G
1
Posts: 177
Reputation: 1,827

Post » Tue Apr 29, 2014 8:35 pm

If you are still interested, you could also use an opaque layer to change to the night time. The fade-in logic however is the same as with a sprite:

http://www.eli0s.com/Tests/NightTime.capx
composer - multimedia artist
www.eli0s.com/en/
B
69
S
27
G
6
Posts: 1,146
Reputation: 10,379

Post » Wed Apr 30, 2014 11:25 am

I will take a look at the example. Right now the eli0s.com seems to be offline.
The opacity parameter helped me a lot already, but dealing with a full layer could be even better.
B
24
S
4
G
1
Posts: 177
Reputation: 1,827

Post » Wed Apr 30, 2014 12:53 pm

I don't understand why eli0s.com seems offline to you. Is it possible that your antivirus is blocking it..? If you like p.m. your email and I will send you the capx there.

-EDIT-

I just realized that I can attach files!
You do not have the required permissions to view the files attached to this post.
composer - multimedia artist
www.eli0s.com/en/
B
69
S
27
G
6
Posts: 1,146
Reputation: 10,379

Post » Wed Apr 30, 2014 8:28 pm

GREAT Example! The random lights then... awesome! Thanks!
B
24
S
4
G
1
Posts: 177
Reputation: 1,827

Post » Wed Apr 30, 2014 8:29 pm

As for the eli0s.com ... tried with firefox, chrome... Windows and Mac... =(
B
24
S
4
G
1
Posts: 177
Reputation: 1,827

Post » Wed Apr 30, 2014 10:04 pm

You are welcome!

I fear that my ftp is somehow blocked on some parts of the world. This is an uneducated guess and I can't support this fear with facts. I will ask a friend of mine who understands ftp and internet stuff...
composer - multimedia artist
www.eli0s.com/en/
B
69
S
27
G
6
Posts: 1,146
Reputation: 10,379


Return to How do I....?

Who is online

Users browsing this forum: Blendi1223, gskunk, richcoz81, zenox98 and 54 guests