Message: 9 Date: Mon, 17 May 2004 08:05:35 -0700 From: Rob Cozens <[EMAIL PROTECTED]> Subject: Drawing a "Centered" Circle To: How to use Revolution <[EMAIL PROTECTED]> Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; charset="us-ascii" ; format="flowed"

Hi All,

Has anyone given any thought or scripting time to exploring what it
would take to draw a circle that is centered over the loc of the
original mouseDown?

In the course of public presentation I would like to project a map
and allow people in the audience to identify an area on the map by
drawing a circle around it with a mouse.

Using Transcript's oval tool the loc & shape of a circle change as
the mouseLoc changes.  I want the effect of a perfect circle growing
or shrinking around a fixed point as the mouse recedes from or
approaches that point.

At the moment, the approach I'm contemplating involves:

1.  Drawing a minimal circle on mouseDown
2.  Changing the oval tool's ink (or visible property?) to make a new
invisible oval.
3.  On mouseMove change the width & height of the original circle to
the distance between the mouseDown loc and the current mouse loc
4.  On mouseUp delete the invisible oval.

Anyone have any comments or a better solution to offer?

TIA.
--

Rob Cozens
CCW, Serendipity Software Company


Rob,

This works for me. It's probably what you had in mind.

Jim

Card Script

local myName,x1,y1 -- Or use custom properties.

on mouseDown
  if there is not graphic "circle" then
    set the style of the templateGraphic to Oval
    create graphic "circle"
  end if
  put the name of me into myname
  put the mouseH into x1
  put the mouseV into y1
end mouseDown

on mouseUP
  put "" into myName
end mouseUP

on mouseMove x,y
  if myName is "" then exit mouseMove
  put distance(x,y) into r
  set the rect of grc "circle" to x1-r,y1-r,x1+r,y1+r
end mouseMove

function distance x,y
  return trunc(sqrt((x1-x)^2 + (y1-y)^2))
end distance
_______________________________________________
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to