|
|
|
Fade till done
Added on 10/20/2000
|
Drop this behaviour on the frame script to hold the fade till finishes.
-- This behaviour on the frame script holds the fade till
-- finishes and goes to the next frame.
-- sunilbalan@usa.net
property pSprite, pFade, pSpeed
on getPropertyDescriptionList
description = [:]
if the currentspritenum > 0 then exit
addprop description, #pSprite, [#comment:"Which sprite to fade:", #default:1, #format:#integer]
addprop description, #pFade, [#comment:"Select your option:", #default:"Fade in", #range:[#"Fade in", #"Fade out"], #format:#string]
addprop description, #pSpeed, [#comment:"Speed of fade", #default:1, #format:#integer, #range:[#"1", #"2", #"4", #"5", #"10", #"20"]]
return description
end getPropertyDescriptionList
on beginsprite
if pFade = "Fade out" then
pFade = 0
pSpeed = - pSpeed
the blend of sprite pSprite = 100
end if
if pFade = "Fade in" then
pFade = 100
the blend of sprite pSprite = 0
end if
end
on exitframe
sprite(pSprite).blend = sprite(pSprite).blend + pSpeed
if sprite(pSprite).blend = pFade then
go the frame +1
else
go the frame
end if
end
|
|