mouseDelta
December 4, 1997
by Alex Zavatone
One thing that is very lacking in Director is the capability to track the mouse position and the mouse delta from a location. Facing the need for such a tool yesterday, I cooked up a simple MIAW (Mac or Windows) in Director 6 which is capable of showing relative mouse position from the point that you set. How do you set the desired point you ask? Simply position the mouse where you want and press control. Then move the mouse to the location you desire and press control again. The distance the mouse travelled from the "origin" is printed out to the message window so you can copy it and paste it where ever you want.
I'm using this tool to help me record values for a routine that will place graphical elements in a window via lingo but it can be used to display how far elements are from each other and how far a graphic is dragged. Hope you find it useful.
Note: thanks to Colin Holgate the MouseOrigin movie now shows the total distance from the original point as well as the h and v distances. For those concerned with accuracy, the distance is calculated as the square root of the sum of the squared h and v distances. But then you knew that didn't you?
Copyright 1997-2024, Director Online. Article content copyright by respective authors.