home *** CD-ROM | disk | FTP | other *** search
- property pTextSprite, pTextMember, pTextLowerLImit, pTextRange, pLineSize, pPageSize, pTextOrigin
-
- on beginSprite me
- pLineSize = 13
- totalLines = 15
- pPageSize = totalLines * pLineSize
- pTextOrigin = 29
- pTextSprite = me.spriteNum
- pTextMember = the member of sprite pTextSprite
- lastOffset = integer(0.5 * totalLines) * pLineSize
- textUpperLimit = member(pTextMember).height - lastOffset
- pTextLowerLImit = 0
- pTextRange = 1165
- set the locV of sprite pTextSprite to pTextOrigin
- end
-
- on scrollText me, direction, scrollType
- case 1 of
- voidp(scrollType):
- scrollAmount = pLineSize
- (scrollType = #page):
- scrollAmount = pPageSize
- end case
- if symbolp(direction) then
- case direction of
- #down:
- scrollDirection = 1
- #up:
- scrollDirection = -1
- end case
- scrollVector = scrollAmount * scrollDirection
- currentPosition = pTextOrigin - the locV of sprite pTextSprite
- nextPosition = currentPosition + scrollVector
- if nextPosition > (pTextLowerLImit + pTextRange) then
- nextPosition = pTextLowerLImit + pTextRange
- else
- if nextPosition < pTextLowerLImit then
- nextPosition = pTextLowerLImit
- end if
- end if
- else
- nextPosition = direction * pTextRange
- end if
- set the locV of sprite pTextSprite to pTextOrigin - nextPosition
- sendAllSprites(#positionIndicator, float(nextPosition) / pTextRange)
- end
-