Sprite Opacity change on mouse hover

Get help using Construct 2

Post » Sun Aug 19, 2012 9:42 pm

Hey everyone. I'm kind of stuck, I have a menu setup and all the buttons are at 50 opacity. I want to set it so whenever the mouse is over a button it changes to 100 opacity. What I'm doing does the job but occasionally if I swipe the mouse over the column of buttons it leaves a trail of them set to 100. What I have is:
condition: mouse is over button, action: Set button opacity to 100

else: Set button opacity to 50

What am I missing?

Your help would be immensely appreciated. :)
B
69
S
21
G
15
Posts: 701
Reputation: 15,629

Post » Sun Aug 19, 2012 9:59 pm

probably should add that each button is the same image. I separated out the buttons by declaring an instance variable for each. Any ideas guys and gals?
B
69
S
21
G
15
Posts: 701
Reputation: 15,629

Post » Sun Aug 19, 2012 10:04 pm

Take a look at this thread and see if it's the same problem:

http://www.scirra.com/forum/mouse-over-problem_topic54028.html?KW=
B
63
S
23
G
17
Posts: 254
Reputation: 14,342

Post » Sun Aug 19, 2012 10:12 pm

Solution-

Capx

Hope this helps


Edit-

Xavier link (above) to Ashley's solution is better!
chrisbrobs2012-08-19 22:19:19
B
19
S
6
G
7
Posts: 1,206
Reputation: 7,300

Post » Mon Aug 20, 2012 12:37 am

@chrisbrobs, @Xavier

Thanks guys,

OMG there's an invert switch. Roflmao, I've never seen that before. That makes so many things soooo much easier. I couldn't seem to find an answer so what I ended up doing was to create a sub group set to disabled. In the group I had it flip through every instance and set the opacity accordingly. Then I called it once the cursor was over an instance. This appears to be much more fluid. Thanks again. :)
B
69
S
21
G
15
Posts: 701
Reputation: 15,629

Post » Mon Aug 20, 2012 12:44 am

@chrisbrobs, @Xavier

Scratch that,

Did the same thing. It does highlight the right button in preview but once I upload it occasionally leaves a bunch lit up. I guess I'll switch back to the way I had it. Not very pretty but never gives a false positive on upload.
B
69
S
21
G
15
Posts: 701
Reputation: 15,629

Post » Mon Aug 20, 2012 12:50 am

buttonopacity.capx

Works fine here, with capx and after uploading
ImageImageImageImage
B
140
S
58
G
36
Posts: 2,547
Reputation: 31,170

Post » Mon Aug 20, 2012 12:53 am

Heres what I've done that seems to work:


Try it out at:
http://apps.facebook.com/relicsofyore

Anyone else have a more basic solution?
B
69
S
21
G
15
Posts: 701
Reputation: 15,629

Post » Mon Aug 20, 2012 12:59 am

- remove that group
- above event 18 put an action:
every tick set Button opacity to 50

should work
ImageImageImageImage
B
140
S
58
G
36
Posts: 2,547
Reputation: 31,170

Post » Mon Aug 20, 2012 1:52 am

@shinkan, won't that cause a fluttering effect as it also sets the highlighted sprite back to 50 as its also highlighting the button? Thank you all for the help btw. :)

lanceal2012-08-20 01:53:21
B
69
S
21
G
15
Posts: 701
Reputation: 15,629

Next

Return to How do I....?

Who is online

Users browsing this forum: ETgirl79 and 15 guests