[request] Add Button OnMouseDown / OnMouseOver Triggers

Discussion and feedback on Construct 2

Post » Sun Nov 23, 2014 11:07 pm

Edit: Bump x 1 (and final)

The Button object and the Mouse objects don't play nicely together. It is not possible to detect when a mouse pointer is over a button object without using other objects to do the detecting. Would it be possible to add triggers like OnMouseDown and OnMouseOver so that it is easier to create feedback effects (by using css)?


-----------------------
Old post below:

I just put together this css your buttons tutorial and in the process learned that it is not possible to detect when the left mouse button is pressed with the mouse pointer over a button. The button on clicked trigger only actions on mouse button release and there is no way of detecting the action using the mouse object. This means that any visual feedback for a mouse click can only be given when the user has finished their input - it looks a bit odd if you hold the mouse button down for 1/2 sec first, for example.

Please could we add a condition to the button object for 'onmousedown' so that we can better control our button effects? Thanks.

Edit: kudos @AllanR for discovering the expression.
Last edited by Colludium on Wed Nov 26, 2014 3:50 pm, edited 2 times in total.
A big fan of JavaScript.
B
74
S
20
G
69
Posts: 2,207
Reputation: 43,836

Post » Mon Nov 24, 2014 12:59 am

I second that motion! : ) OnMouseDown would be very helpful with making more realistic buttons. It would also be nice to be able to implement several other events as well: onmousemove, onmouseout, onmouseover, onmouseup, onwheel.

At first I thought about submitting a bug report. Because when I first started playing with Colludium's tutorial, I tried to use Mouse plugin events (mouse button is down, on button released) as a work-around. But found that the mouse plugin events don't play nicely with the button plugin. If the mouse button is pressed down over a button, but then the mouse is moved off the button object, and then the mouse button is released, the on button released event does not fire. So, if you move the mouse back over the button object, then it was acting like the mouse button was still down (when it wasn't). But, just using mouse events within the button plugin fixed that issue - but meant I had to hack the button plugin to add the onmousedown trigger.
B
95
S
33
G
20
Posts: 438
Reputation: 17,640

Post » Wed Nov 26, 2014 3:50 pm

Bump - 1st and last - see post 1.
A big fan of JavaScript.
B
74
S
20
G
69
Posts: 2,207
Reputation: 43,836

Post » Wed Nov 26, 2014 5:20 pm

i would like to see this too :)
B
23
S
6
G
3
Posts: 316
Reputation: 3,461

Post » Wed Nov 26, 2014 7:23 pm

Same here!
B
12
S
2
Posts: 70
Reputation: 1,074


Return to Construct 2 General

Who is online

Users browsing this forum: Sockratease and 7 guests