drawing with the "drag" command

Scott Rossi scott at tactilemedia.com
Sat Mar 30 18:21:01 EST 2002

Recently, Brad Allen wrote:

> I'm trying to script the drawing of a hexmap, with each hex having an
> individual set of properties. This is easy to do by manually drawing
> each hex, but I'm having trouble automating this process because of a
> weird quirk of the drag command.
> Whenever I use the drag command with a drawing tool (such as regular
> polygon), Revolution creates a graphic which appears to be the
> expected size, but in fact is part of a bigger graphic which always
> ends up being the size of the entire card window.
> Here is an example script which gives this result:
> on drawHexTest
> set the polysides to 6
> choose regular polygon
> drag from "50,50" to "50,80"
> end drawHexTest
> If I iterate the drag command, each subsequent graphic is within the
> same "canvas" and has the very same id. How can I draw individualized
> graphic objects?

The reg poly tool is used to make image objects.  Try this instead:

  set the style of the templateGraphic to "regular"
  set the rect of templateGraphic to 0,0,40,40
  set the polysides of the templateGraphic to 6
  create graphic


Scott Rossi
Creative Director

Tactile Media, Multimedia & Design
Email: scott at tactilemedia.com
Web: www.tactilemedia.com

More information about the use-livecode mailing list