mouse.js - addyh/tetris GitHub Wiki

Globals

  • xDir, yDir -- Remember the direction of mouse dragging
  • lastX, lastY -- Remember the last mouse position

Mouse Events

  • mousePressed() -- Mouse Down Event
  • mouseDragged() -- Mouse Dragged Event
  • mouseReleased() -- Mouse Up Event
  • mouseClicked() -- Mouse Clicked (down-up) Event

Touch Events

Basically equivalent to the Mouse events, just for a touch-screen:

  • touchStarted() -- calls mousePressed
  • touchMoved() -- calls mouseDragged
  • touchEnded() -- calls mouseReleased and mouseClicked

Hovering Function

  • Bool hovering(String buttonName) -- Is the mouse hovering over a specific button?