This is a basic blend routine. Drop it on a sprite and it will blend in and out based upon the distance the mouse is from the sprite.
property maxDistance, spriteNum
on exitFrame me
distance = sqrt(power((the mouseH - sprite(spriteNum).locH), 2) + power((the mouseV - sprite(spriteNum).locV), 2))
if distance < maxDistance then
theBlend = 100 - (100 * (float(distance) / maxDistance))
sprite(spriteNum).blend = theBlend
else
sprite(spriteNum).blend = 0
end if
end
on getPropertyDescriptionList me
p_list = [#maxDistance : [#format : #integer, #comment : "Max distance from the sprite"s reg point:", #default : 200]]
return p_list
end
on getBehaviorDescription me
return "This is a basic blend routine. Drop it on a sprite and it will blend in and out based upon the distance the mouse is from the sprite."
end
Contact
MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA