Help with mouse-drag in html5

Discussion in 'Programming' started by Uhfgood, Jan 4, 2017.

  1. Uhfgood

    Uhfgood Member

    Joined:
    Sep 26, 2016
    Posts:
    87
    So I'm making a breakout clone and I'm running into a small issue. I've got it to where you can use the mouse to drag the paddle (like a scrollbar) -- which is the way I want it to work, and it stops at the wall objects. The small problem I have right now is if I'm holding down the mouse button, and I move outside the window (in html5 target) and let go, as soon as I move the mouse back onto the screen, the paddle continues to follow the mouse.

    I need to know if the mouse is completely outside the window so I can tell it to no longer drag the paddle, is there a way to do this?
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice