|
|
|
ZGTSB-Shape Or Vector Shape Slider Scroll
Added on 5/22/2001
|
This applies to slider sprite of the 'Ziggi Generic Text Scrolling Behaviours' set and brings the slider ability to scroll. The slider graphics must be of shape or vector shape type. For bitmaps use another behaviour.
Download PC Source Download Mac Source
-- ZIGGI GENERIC TEXT SCROLLING BEHAVIOURS --
-- (C) 2001 Zbigniew Szczesny
property pMeSpriteNum, pMeCastLibNum, pMeHeight, pMeStep, pTextSpriteNum, pShift
on getBehaviorDescription
return "This applies to slider sprite of the 'Ziggi Generic Text Scrolling Behaviours' set and brings the slider ability to scroll. The slider graphics must be of shape or vector shape type. For bitmaps use another behaviour."
end
on isOKtoAttach me, spriteType, spriteNum
case spriteType of
#graphic:
meType = sprite(spriteNum).member.type
return meType = #shape or meType = #vectorShape
#script:
return FALSE
end case
end
on beginSprite me
pTextSpriteNum = 1 -- the number of the refering scrolled text/field sprite
pMeSpriteNum = me.spriteNum
pMeCastLibNum = sprite(pMeSpriteNum).castLibNum
pMeHeight = (sprite(pMeSpriteNum).member).height
pMeStep = pMeHeight.float / sprite(pTextSpriteNum).pMeBottom
sprite(pMeSpriteNum).Height = 0
end
on prepareFrame me
pShift = sprite(pTextSpriteNum).member.scrollTop * pMeStep
sprite(pMeSpriteNum).Height = pShift
end
|
|