...go ahead and read the manual, we won't tell anyone.
This example use of the visual command will cause button id 1 to slowly move to the left for 200 pixels.
on mouseUp
visual effect linear slowly
set the left of tile button id 1 to 200
end mouseUp
Depending on what parameters you pass in to the visual command, you can easily achieve some advanced animation effects:
on dropToTheBottom
visual effect bounceout quickly
set the bottom of tile button id 1 to 300
end dropToTheBottom
EffectName is an expression that yields any of the effects names available to the visual command. (Listed at the bottom of this document). Speed can be either one of the natural language speeds (i.e. "Quickly", "Slowly"), or an exact duration for the animation using natural language durations. (i.e. "5 seconds" or "453 milliseconds"). If you do not specify a value for the speed parameter, the default setting of "normal" will be used. (Again, Possible values for the speed parameter are listed at the bottom of this document). Callback is the name of a Speak handler you want invoked when the animation is completed.
on mouseUp
visual effect {effectName} [{speed}] [{callback}]
end mouseUp
Stopping animations in progress is very easy, all you need to do is pass "stop"as the effectName. Note that this will stop ALL currently active animations at their current values.
on mouseUp
visual effect stop
end mouseUp
The visual effect can animate the following Speak properties of buttons and fields: Left,Right,Bottom,Top,Rect, and Opacity. Note, in an actual stack, the following animations would all be kicked off and run simultaneously. If you wanted to sequentially run the animations (one-by-one) you would need to setup callback handlers for each animation.
on mouseUp
visual effect linear slowly
set the left of tile button id 1 to 200
visual effect linear slowly
set the top of tile button id 1 to 200
visual effect linear slowly
set the right of tile button id 1 to 200
visual effect linear slowly
set the bottom of tile button id 1 to 200
visual effect linear slowly
set the rect of tile button id 1 to "0,0,50,26"
visual effect linear slowly
set the opacity of tile button id 1 to 50
end mouseUp
When animating opacity there's two special helpers for hiding and showing you can use to fade elements in and out, then set their visible properties to true and false respectively when the animation completes:
on fadeOut
visual effect linear quickly
hide button id 1
end fadeOut
on fadeIn
visual effect linear quickly
show button id 1
end fadeIn
Here's an example of a visual effect with a callback:
on mouseUp
visual effect linear quickly myCallback
hide button id 1
end mouseUp
on myCallback
answer "I hid the button! You can do other stuff now!"
end myCallback
| Effect Name | Explanation |
|---|---|
linear | Provides a smooth and steady animation from the current value to the ending value. |
bounceout | This effect causes the property to "bounce" into to its ending value. |
elasout | This effect simulates an "Elastic" effect and the animation will go past the ending value then "rubber band" back to its actual desired ending value. |
easein | This effect "Eases In" by starting out slowly then gradually normalizing its pace in the middle. |
easeout | Similar to the "easein" effect, this works in the reverse, gradually slowing down as it reaches the ending value. |
easeInOut | Simply combines the effect of "easein" and "easeout", this effect starts out slow, normalizes in the middle, then slows down towards the end. |
stop | Stops any currently running animations at their current value and calls their callback(s). |
(Speeds can be specified using an exact duration of the animation, or a rate-based value, which will causes the animation to move at the same speed regardless of the "distance" from the starting value to the ending value.)
| Speed Value | Explanation |
|---|---|
slowor slowly | Rate-based |
normal | Rate-based |
fastor quickor quickly | Rate-based |
.5 rate | Rate-based specified using a decimal number between 0 and 1. |
257 msor 257 milliseconds | Exact duration specified in milliseconds. |
2 secsor 2 seconds | Exact duration specified in seconds. |
With all the hustle and bustle of developing and releasing these latest awesome features, it totally...
After two months of good development, I'm pleased to announce TileStack version 0.8 "Delicass"...