home *** CD-ROM | disk | FTP | other *** search
/ The Dynamic Human Version 2.0 / DH2_CD2.ISO / pc / data1.cab / Program_Executable_Files / switch.dxr / 00033_getButtonData.ls < prev    next >
Encoding:
Text File  |  1998-09-29  |  1.1 KB  |  29 lines

  1. on getButtonData buttonName, nextAction, offsetDist
  2.   if voidp(offsetDist) then
  3.     set offsetDist to [0, 0]
  4.   end if
  5.   set whichRegPoint to point(320 + getAt(offsetDist, 1), 240 + getAt(offsetDist, 2))
  6.   set nextRect to getButtonRect(buttonName, whichRegPoint, offsetDist)
  7.   set rolloverButton to 0
  8.   set regionList to [duplicate(nextRect), whichRegPoint, rolloverButton, the number of member buttonName, nextAction]
  9.   return regionList
  10. end
  11.  
  12. on getButtonRect whichMember, whichRegPoint, offsetDist
  13.   if voidp(whichRegPoint) then
  14.     set whichRegPoint to point(320, 240)
  15.   end if
  16.   set nextMemNumber to the number of member whichMember
  17.   set nextRegPoint to the regPoint of cast nextMemNumber
  18.   set nextWidth to the width of cast nextMemNumber
  19.   set nextHeight to the height of cast nextMemNumber
  20.   set centerH to getAt(nextRegPoint, 1)
  21.   set centerV to getAt(nextRegPoint, 2)
  22.   set leftH to getAt(whichRegPoint, 1) - centerH
  23.   set rightH to leftH + nextWidth
  24.   set topV to getAt(whichRegPoint, 2) - centerV
  25.   set bottomV to topV + nextHeight
  26.   set theRect to rect(leftH, topV, rightH, bottomV)
  27.   return theRect
  28. end
  29.