|
|
|
Blur Button-Alphamania
Added on 6/10/1999
|
Requires Effector Set 2. These behaviors are for use with the Alphamania Xtra and its add-on effector sets
property sNum
property overMe
property mode -- blur, or blur in and then out
property startBlur
property endBlur -- where the blur stops and the action begins
property blurResolution
property moveMode -- whether in up or down part of animation
property frameCount -- how much time left in this part of animation
property actionType, actionText -- what to do or where to go
on getBehaviorDescription me
return "A simple button behavior that plays a blur animation when the user clicks. The blur increases after the user clicks. This creates a fade out/blur effect."
end
on getPropertyDescriptionList me
set list = [:]
addProp list, #startBlur, [#comment: "Normal Blur:", #format: #integer, #default: 0, #range: [#max:10, min:0]]
addProp list, #endBlur, [#comment: "Click Blur:", #format: #integer, #default: 5, #range: [#max: 10, #min:0]]
addProp list, #blurResolution, [#comment: "Blur Resolution:", #format: #integer, #default: 1, #range: [#max: 5, #min:1]]
addProp list, #actionType, [#comment: "Action Type:", #format: #symbol, #range: [#goToFrame, #doLingo], #default: #doLingo]
addProp list, #actionText, [#comment: "Action Text:", #format: #string, #default: "beep()"]
return list
end
on beginSprite me
set frameCount = 10
set moveMode = VOID
set overMe = -1
set sNum = the spriteNum of me
blur(sprite sNum, [animMode:#static, blurAmount:startBlur, blurResolution:blurResolution])
end
on mouseDown me
set overMe = TRUE
blur(sprite sNum, [animMode:#range, numFrames:frameCount, endBlur:endBlur])
updateStage
end
on mouseEnter me
if the stillDown and overMe = FALSE then
blur(sprite sNum, [animMode:#range, numFrames:frameCount, endBlur:endBlur])
set overMe = TRUE
end if
end
on mouseLeave me
if the stillDown and overMe = TRUE then
blur(sprite sNum, [animMode:#range, numFrames:frameCount, endBlur:startBlur])
set overMe = FALSE
end if
end
on mouseUp me
if overMe = TRUE then
blur(sprite sNum, [animMode:#static, blurAmount:startBlur])
action(me)
updateStage
end if
set overMe = -1
end
on mouseUpOutside me
set overMe = -1
end
on action me
if actionType = #goToFrame then
if value(actionText) > 0 then
go to frame value(actionText) -- go to frame number
else
go to frame actionText -- go to frame label
end if
else if actionType = #doLingo then
do actionText
end if
end
|
|