Mouse Button Down - Inoperable!

0 favourites
  • 10 posts
From the Asset Store
Create your game with this complete pack of images and animations!
  • Hi all,

    I've discovered that the check for a mouse button down condition... fails if the pointer is over an object.

    Example... if the mouse is down whilst on a slider. I had a great solution to a problem... until I found this issue.

    Does anyone know a way to detect if the mouse button is down, whilst on a slider (or button, or whatever).... OR... is it possible to do a test on the slider... to see if the control is currently being used? Either should work.

    Thanks!

    R

  • You can use a drag and drop behavior on the slider object and limiting it's movement to only the slider.

  • You can use a drag and drop behavior on the slider object and limiting it's movement to only the slider.

    I'm very sorry, but I don't understand at all. I see the DragDrop behavior... but I don't see how to relate that to your suggestion. Could you be more specific?

    Thank you for your kind help

    R

  • You can try either putting an "every tick" "sliderobject.y = 100" while dragging.

    Which will make the object stay in place.

    And if it reaches beyond the slider itself you use the x value to keep it at the end.

    "if sliderobject.x = more than 10" "make sliderobejct.x = 10"

    "if sliderobject.x = less than 0" "make sliderobject.x = 0"

    This will keep the sliderobject.x in between 0 and 10 while you're dragging and always on 100y.

    I hope this made sense and it helps you understand how it might work.

  • You can try either putting an "every tick" "sliderobject.y = 100" while dragging.

    Which will make the object stay in place.

    And if it reaches beyond the slider itself you use the x value to keep it at the end.

    "if sliderobject.x = more than 10" "make sliderobejct.x = 10"

    "if sliderobject.x = less than 0" "make sliderobject.x = 0"

    This will keep the sliderobject.x in between 0 and 10 while you're dragging and always on 100y.

    I hope this made sense and it helps you understand how it might work.

    Well, not really... but I am trying.

    This code seems to be all about moving the slider *object* (as opposed to the slider handle) around.

    I have no interest in moving the slider object anywhere, so I am not sure how any of this helps.

    Now, on the other hand, I DO want to move the slider handle left and right... as designed. And it does that... so no biggie.

    But nowhere in this discussion do I see how to detect that the LMB is down.

    How does the above suggestion tell me that the LMB is down?

  • > You can try either putting an "every tick" "sliderobject.y = 100" while dragging.

    > Which will make the object stay in place.

    > And if it reaches beyond the slider itself you use the x value to keep it at the end.

    > "if sliderobject.x = more than 10" "make sliderobejct.x = 10"

    > "if sliderobject.x = less than 0" "make sliderobject.x = 0"

    > This will keep the sliderobject.x in between 0 and 10 while you're dragging and always on 100y.

    >

    > I hope this made sense and it helps you understand how it might work.

    >

    Well, not really... but I am trying.

    This code seems to be all about moving the slider *object* (as opposed to the slider handle) around.

    I have no interest in moving the slider object anywhere, so I am not sure how any of this helps.

    Now, on the other hand, I DO want to move the slider handle left and right... as designed. And it does that... so no biggie.

    But nowhere in this discussion do I see how to detect that the LMB is down.

    How does the above suggestion tell me that the LMB is down?

    After you've added the mouse object to your project on the layout, just like you would add a new sprite, you go to your events.

    And input this condition: "Mouse > Mouse button is down > Left"

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • >

    > > You can try either putting an "every tick" "sliderobject.y = 100" while dragging.

    > > Which will make the object stay in place.

    > > And if it reaches beyond the slider itself you use the x value to keep it at the end.

    > > "if sliderobject.x = more than 10" "make sliderobejct.x = 10"

    > > "if sliderobject.x = less than 0" "make sliderobject.x = 0"

    > > This will keep the sliderobject.x in between 0 and 10 while you're dragging and always on 100y.

    > >

    > > I hope this made sense and it helps you understand how it might work.

    > >

    >

    > Well, not really... but I am trying.

    >

    > This code seems to be all about moving the slider *object* (as opposed to the slider handle) around.

    >

    > I have no interest in moving the slider object anywhere, so I am not sure how any of this helps.

    >

    > Now, on the other hand, I DO want to move the slider handle left and right... as designed. And it does that... so no biggie.

    >

    > But nowhere in this discussion do I see how to detect that the LMB is down.

    >

    > How does the above suggestion tell me that the LMB is down?

    >

    After you've added the mouse object to your project on the layout, just like you would add a new sprite, you go to your events.

    And input this condition: "Mouse > Mouse button is down > Left"

    Yes, and I've done that from the very start. What I reported with the OP, is that this the Mouse Button is Down fails to function properly, when the pointer is over a control.

    Try it for yourself. If you go over a control, and hold LMB, Mouse Button Down will not register it. It literally can not see that in fact the mouse button is being held down.

    At least, that is what I am seeing here.

    Are you able to verify this?

  • [quote:1te5ig24]

    Try it for yourself. If you go over a control, and hold LMB, Mouse Button Down will not register it. It literally can not see that in fact the mouse button is being held down.

    At least, that is what I am seeing here.

    Are you able to verify this?

    What do you mean "mouse over a control"?

    Can you upload a capx of this?

  • Well I also discovered same,

    Keep your mouse down on slidebar object and use every tick & mouse down in condition and print somewhere mouse.x and mouse.y or whatever you want.

    It will never work,

  • [quote:8uwg70hp]

    Try it for yourself. If you go over a control, and hold LMB, Mouse Button Down will not register it. It literally can not see that in fact the mouse button is being held down.

    At least, that is what I am seeing here.

    Are you able to verify this?

    What do you mean "mouse over a control"?

    Can you upload a capx of this?

    This means, put the mouse pointer directly over a control, as if you plan to use it. Just like when you click your "submit" button to post a message... you have always moused over the "Submit" button with your pointer, yes? The press your left mouse button.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)