Use this simple behavior to have a sprite pulse from big to small and back again
property MaxSize, MinSize, StepSize, Grow, X global MaxSmall, MaxLarge, DefaultWidth, DefaultHeight
on beginSprite me
Set X = the Spritenum of me
PuppetSprite X, TRUE
set the stretch of sprite X = TRUE
set DefaultWidth = the width of sprite X
set DefaultHeight = the height of sprite X
set MaxSmall = the width of sprite X * (MinSize / 100.0)
set MaxLarge = the width of sprite X * (MaxSize / 100.0)
end
on EnterFrame me
if Grow then
Set the Width of Sprite X = the Width of Sprite X + (the Width of Sprite X * (StepSize/100.0))
Set the Height of Sprite X = the Height of Sprite X + (the Height of Sprite X * (StepSize/100.0))
else Set the Width of Sprite X = the Width of Sprite X - (the Width of Sprite X * (StepSize/100.0))
Set the Height of Sprite X = the Height of Sprite X - (the Height of Sprite X * (StepSize/100.0))
end if
if the width of Sprite X = DefaultWidth then
set the height of sprite X = DefaultHeight
else if the Height of sprite X = DefaultHeight then
set the Width of sprite X = DefaultWidth
end if
if the Width of Sprite X >= MaxLarge then
set Grow = FALSE
else if the Width of Sprite X <= MaxSmall then
set Grow = TRUE
end if
end
on getPropertyDescriptionList
set p_list =[ #MaxSize: [#comment:"Percent to GROW to:", #format:#integer, #default: 200, #range:[#min:1,#max:1000] ],#MinSize: [#comment:"Percent to SHRINK to:", #format:#integer, #default: 50, #range:[#min:1,#max:1000] ],#StepSize:[#comment:"Percent to step through:",#format:#integer, #default: 10, #range:[#min:1,#max:1000] ],#Grow: [#comment:"Should it Grow First?:", #format:#boolean, #default: FALSE ]]
return p_list
end
on getBehaviorDescription
return "Use this simple behavior to have a sprite pulse from big to small and back again."
end
Contact
MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA