Can Rev Draw a Line?

J. Landman Gay jacque at hyperactivesw.com
Fri Jan 25 00:19:36 EST 2008


Gardner, Joseph A wrote:
> I know that Rev has drawing TOOLS, but is there no command to make
> Rev draw a line from one point to another using X,Y or screen
> coordinates for example? I'm trying to get Rev to draw a series of
> simple boxes, but I can't seem to find any command to do this. Can
> someone point me in the right direction?

You can use a graphic and set its points, as Ian mentioned, which is 
probably the easiest way. Or you can script the paint tools as we used 
to do in HyperCard. Via script, you can create an image object, choose 
the rectangle tool, and drag from points a,b to x,y. It works as you'd 
expect. If you don't create an image yourself, using the paint tools 
will automatically create an image the size of the card, which might not 
be what you want.

on mouseUp
   create image "boxes"
   set the rect of img "boxes" to 100,100,500,500
   choose rectangle tool
   set the brushcolor to "green"
   drag from 150,150 to 350,350
   set the brushcolor to "blue"
   drag from 300,300 to 450,450
   choose browse tool
end mouseUp

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com



More information about the use-livecode mailing list