How do I trigger on mouse leave

Get help using Construct 2

Post » Tue Mar 11, 2014 8:58 am

Hello,

I have made action on sprite that happens when mouse comes over, is there opposite event for mouse leave so i can revert the state of object?

Thank you.
B
5
Posts: 27
Reputation: 279

Post » Tue Mar 11, 2014 9:02 am

Add a else condition (maybe with a trigger once) ?

on mouse over objet -> do something

else + trigger once -> do something else ?
B
39
S
15
G
5
Posts: 295
Reputation: 6,089

Post » Tue Mar 11, 2014 9:05 am

Else should work in this case,
but it's also possible to invert events by right-clicking and choosing invert,
that way the condition would become "is not overlapping"
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 » Tue Mar 11, 2014 9:35 am

Thank you.

Else is not working it says else cannot be used. But invert works in a weird way.

If i say Mouse event -> is over object - > play animation it actually plays animation when i move mouse out of object
if i do Mouse event -> is not over object -> play animation then animation plays when mouse is over object

This is weird, don't know is it really a bug i have couple more of similar things to do and will post findings. But it's important that it works.
B
5
Posts: 27
Reputation: 279

Post » Tue Mar 11, 2014 9:41 am

Right click on you "Mouse over object" add Else. I tested it and it worked.
B
39
S
15
G
5
Posts: 295
Reputation: 6,089

Post » Tue Mar 11, 2014 9:46 am

I just get written in red Else(not valid here)

I go to System -> Else (Maybe I'm doing something wrong there)

also

I can confirm for some reason that mouse over activates animation only if i invert Cursor is over event and that is strange behaviour:) but hey it works.
B
5
Posts: 27
Reputation: 279

Post » Tue Mar 11, 2014 9:52 am

Like this :
You do not have the required permissions to view the files attached to this post.
B
39
S
15
G
5
Posts: 295
Reputation: 6,089

Post » Tue Mar 11, 2014 10:25 am

Joskin, thank you that's it... i have tried to put in to same block under 1. that's why I had problems. Coming from programming background somehow seemed logic to be in one block :)

Also need to report other weird thing.

Cursor is over inverted in case of animation only works opposite, so if i set inverted it activates animation actually when it's over sprite even though it should be other way around.

But for other things it works as advertised.
B
5
Posts: 27
Reputation: 279


Return to How do I....?

Who is online

Users browsing this forum: BadMario, mr32D, mtnboy22 and 2 guests