home *** CD-ROM | disk | FTP | other *** search
Wrap
property startBlend, StartFadePoint, EndFadePoint on beginSprite me puppetSprite(me.spriteNum, 1) set the blend of sprite the spriteNum of me to startBlend updateStage() end on exitFrame me sendSprite(me.spriteNum, #blendit) end on blendSprite which, what set the blend of sprite which to what updateStage() end on blendit me dv = abs(the locV of sprite me.spriteNum - the mouseV) dH = abs(the locH of sprite me.spriteNum - the mouseH) distance = sqrt((dv * dv) + (dH * dH)) if distance < EndFadePoint then blendSprite(me.spriteNum, 100) exit end if if distance < StartFadePoint then percentage = distance * 100 / StartFadePoint blendToValue = 100 - percentage if blendToValue < startBlend then blendToValue = startBlend end if blendSprite(me.spriteNum, blendToValue) volume = blendToValue / 10 else blendSprite(me.spriteNum, startBlend) end if updateStage() end on getPropertyDescriptionList p_list = [#startBlend: [#default: 0, #format: #integer, #comment: "Initial Blend", #range: [#min: 0, #max: 100]], #StartFadePoint: [#default: 100, #format: #integer, #comment: "Trigger Point", #range: [#min: 0, #max: 500]], #EndFadePoint: [#default: 0, #format: #integer, #comment: "End Trigger Point", #range: [#min: 0, #max: 50]]] return p_list end on getBehaviorDescription return "Creates sprites that fade in and out (using the sprite blend property) depending how far they are from the mouse. " & RETURN & RETURN & "Try different inks for your sprites - different images require different settings. Also, there appears to be a bug in Director 6 that prevents sprites with a blend of 0 from being totally hidden. " end