Hi Leah,

> Thanks for the help...it's just what I needed..
in fact I've just reused it in a projet yesterday, and I've found a little
bug while trying to draw horizontal or vertical lines (in tohses cases width
or height are equal to 0).
So i've added another shape member (a rect, no longer a line) named
'line_full', and modified the drawing scritp to have now:

on DrawLineShape (ptStart, ptEnd, lineSprite)
  -- slope handling
  deltaH = ptEnd[1] - ptStart[1]
  deltaV = ptEnd[2] - ptStart[2]

  if not deltaH then
    mySize = lineSprite.lineSize
    theMember = member("line_full")
    ptStart   = ptStart+point(mySize,mySize)
  else if not deltaV then
    mySize = lineSprite.lineSize
    theMember = member("line_full")
    ptStart   = ptStart+point(mySize,mySize)
  else
    if (deltaH*deltaV > 0) then
      theMember = member("line down")
    else
      theMember = member("line up")
    end if
  end if
  lineSprite.member = theMember
  lineSprite.rect   = rect(ptStart, ptEnd)
end -- DrawLineShape handler

So to draw a line the code might be:
  puppetSprite currentChannel, TRUE
  lineSprite           = sprite(currentChannel)
  lineSprite.member    = member("line up")
  lineSprite.loc       = pStartLoc
  lineSprite.lineSize  = 1
  lineSprite.foreColor = 255

then calling
  DrawLineShape (pStartLoc, ptEnd, lineSprite)

hth,
.s�b

[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]

Reply via email to