Created
September 22, 2014 14:23
-
-
Save YellowAfterlife/2e821339a333dab772df to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Create: | |
globalvar mouse_x0, mouse_y0, mouse_x1, mouse_y1, mouse_dx, mouse_dy; | |
mouse_x1 = mouse_x | |
mouse_y1 = mouse_y | |
mouse_dx = 0 | |
mouse_dy = 0 | |
/// Step: | |
mouse_x0 = mouse_x1; mouse_x1 = mouse_x | |
mouse_y0 = mouse_y1; mouse_y1 = mouse_y | |
mouse_dx = (mouse_x1 - mouse_x0) | |
mouse_dy = (mouse_y1 - mouse_y0) | |
/// Example of use: | |
if (mouse_dx != 0) || (mouse_dy != 0) { | |
// mouse moved. | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment