How do I fade in or fade out in mouse over sprite object

Get help using Construct 2

Post » Sat Apr 25, 2015 11:36 am

How do I fade in or fade out in mouse over sprite object?
B
13
S
2
Posts: 95
Reputation: 861

Post » Sat Apr 25, 2015 11:47 am

Add FADE behaviour to the sprite.
Set enabled to no in the properties.
In events, add..

+ MOUSE: On cursor over sprite
+ Trigger Once While True
- sprite: Start Fade
B
15
S
5
G
7
Posts: 876
Reputation: 5,650

Post » Sat Apr 25, 2015 2:35 pm

Thank you!!! Now I see my question is inaccurate.
I'm building browser game and I want to add a menu which is slightly transparent (50%) and when i move with the mouse on the menu (my sprite) transparency changes to 100% (Shown) and it shows better and when i leaves the sprite with the mouse the transparent returns to 50%
B
13
S
2
Posts: 95
Reputation: 861

Post » Sat Apr 25, 2015 3:17 pm

without animation it would be

+Mouse on cursor over sprite
- sprite set opacity 100

Else - sprite set opacity to 50

if you want the opacity to slowly change:

+Mouse on cursor over sprite
- sprite set opacity sprite.opacity+1

Else
sprite compare opacity > 51
- sprite set opacity to sprite.opacity-1
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sun Apr 26, 2015 5:48 am

It works great thanks!!!
B
13
S
2
Posts: 95
Reputation: 861


Return to How do I....?

Who is online

Users browsing this forum: SturmIV and 4 guests