home *** CD-ROM | disk | FTP | other *** search
- property textSprite, myScrollDelay, minSafeArea, maxSafeArea, topLimit, bottomLimit, activeLeft, activeRight
- global gMasterObj
-
- on new me
- return me
- end
-
- on init me, whichTextSprite, scrollDelay, safeArea, tLimit, bLimit
- set textSprite to whichTextSprite
- set myScrollDelay to scrollDelay
- set myOffset to safeArea / 2.0
- set minSafeArea to 241 - myOffset
- set maxSafeArea to 240 + myOffset
- set topLimit to tLimit
- set bottomLimit to bLimit
- set activeLeft to the left of sprite textSprite
- set activeRight to the right of sprite textSprite
- puppetSprite(textSprite, 1)
- append(the actorList, me)
- end
-
- on stepFrame me
- if (the mouseH > activeLeft) and (the mouseH < activeRight) then
- if the mouseV > maxSafeArea then
- setCursorExemption(gMasterObj, 1)
- set myDirection to (the mouseV - (maxSafeArea - 10)) / myScrollDelay
- scrollUp(me, myDirection)
- else
- if the mouseV < minSafeArea then
- setCursorExemption(gMasterObj, 1)
- set myDirection to (the mouseV - (minSafeArea + 10)) / myScrollDelay
- scrollDown(me, myDirection)
- else
- setCursorExemption(gMasterObj, 0)
- end if
- end if
- else
- end if
- end
-
- on scrollUp me, myDirection
- set newPos to the locV of sprite textSprite - myDirection
- if newPos < topLimit then
- cursor([7, 8])
- set the locV of sprite textSprite to topLimit
- else
- cursor([3, 4])
- set the locV of sprite textSprite to newPos
- end if
- end
-
- on scrollDown me, myDirection
- set newPos to the locV of sprite textSprite - myDirection
- if newPos > bottomLimit then
- cursor([5, 6])
- set the locV of sprite textSprite to bottomLimit
- else
- cursor([1, 2])
- set the locV of sprite textSprite to newPos
- end if
- end
-