|
|
|
Scrollable Sprites
Added on 6/7/1999
|
For use with the Scroll Button Scroll Button, Scroll Thumb, and the Scroll Thumb Track behaviors
This behavior allows the author to select direction for which the thumb (sprite) which will move when called by the ScrollButton behavior. It uses a global variable which is incremented by the ScrollButton behavior. NOTE: the motion of the sprite is opposite the direction of the scroll arrow and the scroll thumb.
property pMyRange -- number of pixels that the sprite may move
property pMyIncrement -- number of pixels that the thumb sprite will advance per click
property pMyStartV -- initial locV of the thumb sprite
property pMyStartH -- initial locH of the thumb sprite
global gScrollV -- amount scroll has been incremented Vertically from initial value
global gScrollH -- amount scroll has been incremented Horizontally from initial value
on getPropertyDescriptionList
set directionList = [#HORIZONTAL, #VERTICAL]
set p_list = [ ¬
#pMyRange: [ #comment: "Range of motion (in pixels)", ¬
#format: #integer,¬
#default: 100] ¬
]
return p_list
end
on beginSprite me
set pMyStartH = the locH of sprite the spriteNum of me
set pMyStartV = the locV of sprite the spriteNum of me
end
on setThumbH me, thumbRange, thumbSprite
set pMyIncrement = pMyRange * 1.00/thumbRange
set the locH of sprite the spriteNum of me = pMyStartH - integer(gScrollH * pMyIncrement)
end
on setThumbV me, thumbRange, thumbSprite
set pMyIncrement = pMyRange * 1.00/thumbRange
set the locV of sprite the spriteNum of me = pMyStartV - integer(gScrollV * pMyIncrement)
end
on scrollH me
set the locH of sprite the spriteNum of me = pMyStartH - integer(gScrollH * pMyIncrement)
end
on scrollV me
set the locV of sprite the spriteNum of me = pMyStartV - integer(gScrollV * pMyIncrement)
end
|
|