A better tape measurement script, please

DunbarX at aol.com DunbarX at aol.com
Mon Jun 14 09:07:10 EDT 2010


Your script works fine. Do you mean that   other graphics get in the way, 
visually, of your tape measure graphic? If so, can you hide them while you 
are measuring, or bring the graphic to the front? If not, as Colin points out, 
what exactly is going wrong?

Craig Newman

In a message dated 6/14/10 7:50:06 AM, michael-kristensen at dsa-net.dk 
writes:


> on mouseUp
>     set the cursor to cross
> 
>     wait until the mouse is down
>     put the mouseH into x1
>     put the mouseV into y1
> 
>     put the mouseLoc into line 1 of mStart
>     show grc Tape
> 
>     repeat while the mouse is down
>        put the mouseLoc into line 2 of mStart
>        set the points of grc Tape to mStart
>     end repeat
> 
>     hide grc Tape
> 
>     put the mouseH into x2
>     put the mouseV into y2
> 
>     put abs(x2-x1) into dx
>     put abs(y2-y1) into dy
> 
>     put 72/2.54 into Q
> 
>     put sqrt (dx^2 + dy^2) into xPix
> 
>     put xPix/Q into xCm
> 
>     set the numberFormat to "#.0"
> 
>     put xCm && "cm" into fld Distance
> end mouseUp
> 



More information about the use-livecode mailing list