Implement "on Mouse over" and "on Mouse out"

Discussion and feedback on Construct 2

Post » Tue Dec 23, 2014 11:39 am

Currently, these are the available triggers:

On object Clicked:
You get to choose "Left", "Middle" or "Right".
You get to choose "Clicked" or "Double-clicked".
You get to choose the Object to click on as opposed to "On click".

Cursor is over object:
This will trigger continuously when you are over a specific object.

On mouse wheel:
You get to choose "down" or "up".
One time trigger unless you keep on scrolling.

Mouse button is down:
You get to choose "Left", "Middle" or "Right".
This will trigger continuously until that specific mouse button is no longer down.

On any click:
Trigger once, on any click.

On click:
You get to choose "Left", "Middle" or "Right".
You get to choose "Clicked" or "Double-clicked".
But you don't get to choose which object to double click on.
You have to use "On object Clicked" for that.

On button released:
You get to choose "Left", "Middle" or "Right".
Trigger once.

==================================================
Feature request:
"on Mouse over":
Trigger once only the minute mouse is over a specific object, very common usage in Flash.
As opposed to "Cursor is over object" which trigger continuously.

"on Mouse out":
Yap, no explanations needed.

I understand that this could be accomplished easily by monitoring "Cursor is over object", but this way of reasoning would also be along the line of someone saying why would we need "On collision with another Object" for Sprites that triggers only once when we already have "Is overlapping another object" and all we need to do is monitor the "Is overlapping another object" trigger.
B
12
S
3
Posts: 288
Reputation: 1,694

Post » Tue Dec 23, 2014 12:47 pm

On any condition that fires continuously, like the "is over object", you can use the system's condition "trigger once while true" (add it as a second condition on the same event).
This way, in essence, you convert it into a trigger event.
composer - multimedia artist
www.eli0s.com/en/
B
69
S
27
G
6
Posts: 1,146
Reputation: 10,379

Post » Tue Dec 23, 2014 2:51 pm

Image
B
12
S
3
Posts: 288
Reputation: 1,694

Post » Wed Dec 24, 2014 12:15 am

@Toddler ,

You are right, it seems like there isn't a difference between "on collision" and "is overlapping+Trigger once". I don't feel like this makes the "on collision" superfluous", I find it to be just an other way to reach the same goal.

Thinking like this, I find the onMouseOver/out triggers a logical request.
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 Dec 24, 2014 9:32 am

@eli0s the good thing about adding these as triggers rather than using conditions is that it would help improve performance as well, because triggers aren't checked every frame.
B
42
S
14
G
3
Posts: 165
Reputation: 5,115

Post » Wed Dec 24, 2014 9:54 am

Yes eli0s, we both agree that OnMouseOver and OnMouseOut trigger is a logical and consistent step :)
B
12
S
3
Posts: 288
Reputation: 1,694

Post » Wed Dec 24, 2014 12:31 pm

@Sumyjkl , up until now I've naively assumed that adding the "Trigger once while true" somehow "converts" the event in to a trigger! Can you please confirm that adding the "Trigger once while true" condition into an event doesn't affect how often the system checks if the conditions are met and that it does indeed update/calculate every tick?!?
composer - multimedia artist
www.eli0s.com/en/
B
69
S
27
G
6
Posts: 1,146
Reputation: 10,379

Post » Wed Dec 24, 2014 1:23 pm

eli0s wrote:@Sumyjkl , up until now I've naively assumed that adding the "Trigger once while true" somehow "converts" the event in to a trigger! Can you please confirm that adding the "Trigger once while true" condition into an event doesn't affect how often the system checks if the conditions are met and that it does indeed update/calculate every tick?!?


a trigger just happens (the on collision being the black sheep of the list, as it stil requires quite a lot of work), where an event with trigger once requires to check every tick if the conditions are true or not.

also, you can put a triggered everywhere, the result will be the same (unless you have two of the same trigger), while an event with trigger once still depends on its place inside the event sheet. Triggers can happen multiple times per tick(function object being the all time representant of that, on created and on destroyed too), trigger once cannot (Is overllaping with trigger once will not work if multiple overlaps exists, as the event will be read only once in total for this tick).

triggers are almost always better than their cousins "check but trigger only once" when you can use them, as they do not check things every tick, they just happen (and can happen outside of the every tick logic, like you press a button, it should fire even if you are not currently reading the event sheet.)
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
53
S
22
G
18
Posts: 2,122
Reputation: 17,123

Post » Wed Dec 24, 2014 2:16 pm

So Aphrodite, it seems you would agree for performance reasons that we should add this also for consistency sake then :)
B
12
S
3
Posts: 288
Reputation: 1,694

Post » Wed Dec 24, 2014 2:19 pm

@Aphrodite , thank you very much for your detailed and thorough answer! That explains a lot and now I understand that there are significant differences between the two methods. This makes Toddler's request even more logical!
composer - multimedia artist
www.eli0s.com/en/
B
69
S
27
G
6
Posts: 1,146
Reputation: 10,379

Next

Return to Construct 2 General

Who is online

Users browsing this forum: Yahoo [Bot] and 10 guests