U
Uhfgood
Guest
This is probably the last post I'll do in the subject. I figure the only reason I haven't been responded to before is because I'm not defining the problem well enough or I'm not clear enough.
So basically in my breakout clone I'm making the player drag the paddle left or right like a scroll bar. This means left clicking on the paddle holding it down and moving it left or right. When you let up on the button it stops being dragged. I have a small problem where if you are still holding down the mouse button when the mouse leaves the canvas (game) area it will not register the mouse button as being released. So basically I want it to stop dragging the paddle if you let go of the button OR the mouse leaves the canvas. Right now if you leave the canvas area and let go of the mouse button and move the mouse back onto the canvas, the paddle moves as though you're still dragging it. I want you to have to manually "re-drag" it or basically you have to drag it again by hitting the mouse button on the paddle before it will move again.
I put a step event in the paddle object and you can find the code here: https://forum.yoyogames.com/index.php?threads/mouse-leaving-canvas-area-in-html5.16521/
So can anyone help me?
So basically in my breakout clone I'm making the player drag the paddle left or right like a scroll bar. This means left clicking on the paddle holding it down and moving it left or right. When you let up on the button it stops being dragged. I have a small problem where if you are still holding down the mouse button when the mouse leaves the canvas (game) area it will not register the mouse button as being released. So basically I want it to stop dragging the paddle if you let go of the button OR the mouse leaves the canvas. Right now if you leave the canvas area and let go of the mouse button and move the mouse back onto the canvas, the paddle moves as though you're still dragging it. I want you to have to manually "re-drag" it or basically you have to drag it again by hitting the mouse button on the paddle before it will move again.
I put a step event in the paddle object and you can find the code here: https://forum.yoyogames.com/index.php?threads/mouse-leaving-canvas-area-in-html5.16521/
So can anyone help me?