|
|
|
Animate Text By Font Size
Added on 11/29/2000
|
Zoom fint size on text
Download PC Source Download Mac Source
--786
--Behaviour: Animate Text By Font Size
--By: Hasan yasar Kazmi
--Hamdard University Islamabad
--Dir@37.com
--19/Nov/2000.
-- Instructiions:
-- Attach with any Text OR Field Sprites.
property spritenum, FontSize, effect, Event, CSize
on getPropertyDescriptionList
set description = [:]
addProp description, #spritenum, [#default: 1,#format:#integer, #comment: "Text Sprite Num:"]
addProp description, #FontSize, [#default:1,#format: #integer, #comment:"Size Increment", #range: [#min:1, #max:50]]
addProp description, #effect, [#default:"Decrease",#format: #string, #comment:"Effect", #range: ["Increase","Decrease"]]
addProp description, #event, [#default:"MouseUp",#format:#string, #comment:"On Event", #range: ["MouseUp","MouseDown","MouseEnter","MouseLeave"]]
return description
end
on getBehaviorDescription
return "Animates text by increasing or decreasing FontSize"
end
on getBehaviorTooltip
return "Animate Text By Changing Font Size"
end
-- events --
on mouseUp me
if event="MouseUp" then
Animate
end if
end
on mouseDown me
if event="MouseDown" then
Animate
end if
end
on mouseEnter me
if event="MouseEnter" then
Animate
end if
end
on mouseLeave me
if event="MouseLeave" then
Animate
end if
end
On Animate
set CSize = sprite(spritenum).member.FontSize
case (effect) of
"Increase":
repeat with i = 1 to FontSize
sprite(spritenum).member.FontSize = CSize + i
updatestage
end repeat
"Decrease":
repeat with i = 1 to FontSize
sprite(spritenum).member.FontSize = CSize - i
updatestage
end repeat
end case
end Animate
|
|