a mouseclick vs a held mouse
BlitzMax Forums/BlitzMax Beginners Area/a mouseclick vs a held mouse
| ||
hey everyone I was wondering whether there were any built in commands to handle a clicked mouse vs a dragged mouse? |
| ||
MouseHit() MouseDown() |
| ||
the problem with that is that mousehit() returns true even if you continue holding the mouse. I mean I hve code that works alright, I was just wondering if there was something easier. |
| ||
MouseHit() only returns 'true' if you click the mouse. It will continue to return 'false' thereafter until you click the mouse button again. Working example: 'check results in the output window Graphics 640,480 While Not KeyDown(key_escape) Cls If MouseHit(1) Print "Mouse clicked" EndIf Flip Wend You should post some code. |
| ||
Basically it's for a RTS game that I tried to start last night. It needs to differentiate between a single click and click that continues to be held down. I have some code that gives the desired functionality that I can post but it's not exactly clean. In fact, that's the reason why I wanted to see if there was a built in way of doing it. |