[bmx] MouseXSpeed, MouseYSpeed and MouseZSpeed by Perturbatio [ 1+ years ago ]

Started by BlitzBot, June 29, 2017, 00:28:42

Previous topic - Next topic

BlitzBot

Title : MouseXSpeed, MouseYSpeed and MouseZSpeed
Author : Perturbatio
Posted : 1+ years ago

Description : For help with B3D users converting to BMax

Code :
Code: blitzmax
Function MouseXSpeed:Int()
	Global lastX:Int =0
	Local result:Int = MouseX()-lastX
	lastX = MouseX()	
	Return result
End Function


Function MouseYSpeed:Int()
	Global lastY:Int =0
	Local result:Int = MouseY()-lastY
	lastY = MouseY()	
	Return result
End Function


Function MouseZSpeed:Int()
	Global lastZ:Int =0
	Local result:Int = MouseZ()-lastZ
	lastZ = MouseZ()	
	Return result
End Function


Comments :


*(Posted 1+ years ago)

 Doesnt work with movemouse like the Blitz3d version does.


Yan(Posted 1+ years ago)

 Add a reset flag to X/Y functions and 'overload' movemouse to also call the X/Y functions with the reset flag set.??


Ked(Posted 1+ years ago)

 See here: <a href="../Community/postsa7c0-2.html?topic=82710" target="_blank">http://www.blitzbasic.com/Community/posts.php?topic=82710</a>