home *** CD-ROM | disk | FTP | other *** search
/ PC Home 49 / PC_Home_Issue_49.iso / winprogs / childenc / oecdemo / shared.dir / 00382.ls < prev    next >
Encoding:
Text File  |  1996-07-24  |  2.2 KB  |  67 lines

  1. on GetareaList spriteRange, theCastNum
  2.   global areaList, CR
  3.   set start to string(item 1 of spriteRange)
  4.   set finish to string(item 2 of spriteRange)
  5.   set areaList to EMPTY
  6.   repeat with n = value(start) to value(finish)
  7.     set theLine to the left of sprite n & "," & the top of sprite n & "," & the right of sprite n & "," & the bottom of sprite n
  8.     if areaList = EMPTY then
  9.       set areaList to theLine & "," & 1 & ","
  10.       next repeat
  11.     end if
  12.     set areaList to areaList & RETURN & theLine & "," & 1 & ","
  13.   end repeat
  14.   if integerp(theCastNum) then
  15.     set x to the text of cast theCastNum
  16.     if stringp(x) then
  17.       set the text of cast theCastNum to x & RETURN & areaList
  18.     else
  19.       set the text of cast theCastNum to areaList
  20.     end if
  21.   else
  22.     put RETURN & areaList & RETURN
  23.   end if
  24. end
  25.  
  26. on GetOffsetList winSprite, spriteRange, theCastNum
  27.   global areaList, CR
  28.   set TP to the top of sprite winSprite
  29.   set LT to the left of sprite winSprite
  30.   set start to string(item 1 of spriteRange)
  31.   set finish to string(item 2 of spriteRange)
  32.   set areaList to EMPTY
  33.   repeat with n = value(start) to value(finish)
  34.     set theLine to the left of sprite n - LT & "," & the top of sprite n - TP & "," & the right of sprite n - LT & "," & the bottom of sprite n - TP
  35.     if areaList = EMPTY then
  36.       set areaList to theLine & "," & 1 & ","
  37.       next repeat
  38.     end if
  39.     set areaList to areaList & RETURN & theLine & "," & 1 & ","
  40.   end repeat
  41.   if integerp(theCastNum) then
  42.     set x to the text of cast theCastNum
  43.     if stringp(x) then
  44.       set the text of cast theCastNum to x & RETURN & areaList
  45.     else
  46.       set the text of cast theCastNum to areaList
  47.     end if
  48.   else
  49.     put RETURN & areaList & RETURN
  50.   end if
  51. end
  52.  
  53. on setShadow me, shadWd
  54.   global CR
  55.   set theCast to the castNum of sprite me
  56.   if string(theCast) = 0 then
  57.     put "No cast in sprite channel" && me
  58.     beep()
  59.     exit
  60.   end if
  61.   set l to value(shadWd) + the left of sprite me
  62.   set r to value(shadWd) + the right of sprite me
  63.   set t to value(shadWd) + the top of sprite me
  64.   set b to value(shadWd) + the bottom of sprite me
  65.   put CR & "left" && l & CR & "top" && t & CR & "width" && r - l + 1 & CR & "height" && b - t + 1
  66. end
  67.