func_input_mousehit.rst 834 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. .. _func_input_mousehit:
  2. ========
  3. MouseHit
  4. ========
  5. MouseHit -
  6. Description
  7. ===========
  8. .. code-block:: blitzmax
  9. MouseHit( button )
  10. Check for mouse button click
  11. The returned value represents the number of the times @button has been clicked since the
  12. last call to #MouseHit with the same @button.
  13. @button should be 1 for the left mouse button, 2 for the right mouse button or 3 for the
  14. middle mouse button.
  15. Parameters
  16. ==========
  17. Return Values
  18. =============
  19. Number of times @button has been clicked.
  20. Examples
  21. ========
  22. .. code-block:: blitzmax
  23. ' mousehit.bmx
  24. graphics 640,480
  25. while not keyhit(KEY_ESCAPE)
  26. cls
  27. if mousehit(1) drawrect 0,0,200,200
  28. if mousehit(2) drawrect 200,0,200,200
  29. if mousehit(3) drawrect 400,0,200,200
  30. flip
  31. wend
  32. See Also
  33. ========