on beginSprite me
spriteRef = sprite(me.spriteNum)
spriteRef.blend = sBlend
blendChange = eBlend - sBlend
startTicks = the ticks
endTicks = startTicks + TicksForTransition
end
on endSprite me
spriteRef.blend = eBlend
end
on exitframe me
myProgress = (float(the ticks - startTicks)/TicksForTransition)
if myProgress > .95 then myProgress = 1
myBlend = sBlend + integer( blendChange * myProgress )
spriteRef.blend = myBlend
if holdForCompletion and (myProgress < 1) then go to the frame
end
----------
on getPropertyDescriptionList
if the currentSpriteNum > 0 then defaultStartBlend = the blend of sprite(the currentSpriteNum)
else defaultStartBlend = 0
defaultEndBlend = 100 - defaultStartBlend
p_list = [:]
addProp p_list, #TicksForTransition, [ #comment: "Number of ticks for the transition:", #format: #integer, #default: 120, #range: [#min:1, #max:1200]]
addProp p_list, #sBlend, [ #comment: "Start blend:", #format: #integer, #default: defaultStartBlend, #range: [#min:0, #max:100]]
addProp p_list, #eBlend, [ #comment: "Ending blend:", #format: #integer, #default: defaultEndBlend, #range: [#min:0, #max:100]]
addProp p_List, #holdForCompletion, [ #comment: "Hold on frame until completion?:", #format: #boolean, #default: 0]
return p_list
end
on getBehaviorDescription
msg = "Fades the sprite in or out using blends over a specified time span. " & return & return
put " - Specify the timespan for the transition" & return after msg
put " - Specify the starting and ending blend values" & return after msg
put " - Specify whether to hold on the frame until the transition complete" after msg
return msg
end
Contact
MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA