FEEDBACK
...go ahead and read the manual, we won't tell anyone.

visual

Tags: Command | Has 0 comments
The visual command allows you to animate objects in your stack. Currently it only support animating parts (fields and buttons). In the future however, it will allow you to animate transitions between tiles. Using the command is a two-step process. First you invoke the command, passing it configuration parameters, then you set the property you'd like to animate and the animation is kicked off at the end of the current handler. This allows you queue up multiple, simultaneous animations at once. If this all sounds confusing, don't worry, once you see the command in action, it will all make sense.



Examples:

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

Usage:

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


Notes:

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


EffectName is one of the following:

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).


Speed is one of the following:

(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
slow
or
slowly
Rate-based
normal
Rate-based
fast
or
quick
or
quickly
Rate-based
.5 rate
Rate-based specified using a decimal number between 0 and 1.
257 ms
or
257 milliseconds
Exact duration specified in milliseconds.
2 secs
or
2 seconds
Exact duration specified in seconds.


Go ahead and login/signup to leave a comment!

Latest Blog PostsView All >

Video Demos Of Some Great New Features!

posted on November 09, 2009 by Jake Marsh

With all the hustle and bustle of developing and releasing these latest awesome features, it totally...

TileStack.com Release Delicass v0.8 Has Landed!

posted on November 04, 2009 by Ted

After two months of good development, I'm pleased to announce TileStack version 0.8 "Delicass"...

Made by the genuine people personalities of    Copyright © 2008-2009 - All Rights Reserved