BiSizeAnimator

This class is used to animate the size of BiComponent(s) and can be used to create visual effects.

This class extends BiComponentAnimation and therefore all methods and fields available for BiComponentAnimation are also available for BiSizeAnimator .

Constructor

new BiSizeAnimator ( [ nFromWidth [ ,nFromHeight [ ,nToWidth [ ,nToHeight [ ,nSpeed [ ,bLoop [ ,nAccType [ ,oComp [ ,nFrameRate [ ,bAutoStart ] ] ] ] ] ] ] ] ] ] )

Parameters

NameTypeOptionalDefaultDescripton
nFromWidthNumberchecked0 Starting width of the component
nFromHeightNumberchecked0 Starting height of the component
nToWidthNumberchecked0 Destination width of the component
nToHeightNumberchecked0 Destination height of the component
nSpeedNumberchecked500 The desired time/length of the animation, measured in milliseconds
bLoopBooleancheckedfalse Loops animation endlessly
nAccTypeNumbercheckedBiComponentAnimation.CONSTANT_SPEED Acceleration type. Use constants from BiComponentAnimation.
oCompBiComponentcheckedA component to animate
nFrameRateNumbercheckedBiFpsGenerator.DEFAULT_FRAME_RATE FPS, Frames Per Second
bAutoStartBooleancheckedfalseIf set to true the animation will start immediately

Properties

NameTypegetsetDescripton
accTypevoidcheckedSets the acceleration type. Use constants from BiComponentAnimation.
fromComponentvoidcheckedBy setting the from-component you specify another BiComponent whos size will be used for the animation's start state. If the from-component's size is changed, the animation will update dynamically.
fromHeightvoidcheckedStarting height of the component
fromSizevoidcheckedSets starting size for both width and height.
Note: The component will be square shaped.
fromWidthvoidcheckedStarting width of the component
speedvoidcheckedSets the duration of the animation. Can be set in three different ways:
1. BiSizeAnimator.SPEEDx constants can be used.
2. One of the following strings: slowest, slow, normal, fast, fastest.
3. A number representing the length of the animation, measured in milliseconds.
toComponentvoidcheckedBy setting the to-component you specify another BiComponent whos size will be used for the animation's target state. If the to-component's size is changed, the animation will update dynamically.
toHeightvoidcheckedDestination height of the component
toSizevoidcheckedSets target size for both width and height.
Note: The component will be square shaped.
toWidthvoidcheckedDestination width of the component
typevoidcheckedSets speed and acceleration type to useful values. Can be one of the following string values:
normal, smooth

Methods

NameDescription
disposePlease call this when you no longer need the animator.
setFromToSets up all the size parameters.

Events

None.

Static Methods

NameDescription
createNormalResizeStatic convenience method that resizes one component and then stops.
Autostarts and autodisposes itself.
createSmoothResizeStatic convenience method that resizes one component and then stops.
Autostarts and autodisposes itself.

Static Fields

NameTypeDescripton
SPEED1NumberPredefined speed - slowest
SPEED2NumberPredefined speed - slow
SPEED3NumberPredefined speed - normal
SPEED4NumberPredefined speed - fast
SPEED5NumberPredefined speed - fastest

Remarks

None.

Method Details

dispose

Please call this when you no longer need the animator.

Syntax

object.dispose ( )

Parameters

No arguments.

Return Type

void

setFromTo

Sets up all the size parameters.

Syntax

object.setFromTo ( [ nFromWidth [ ,nFromHeight [ ,nToWidth [ ,nToHeight ] ] ] ] )

Parameters

NameTypeOptionalDefaultDescripton
nFromWidthNumberchecked0 Starting width of the component
nFromHeightNumberchecked0 Starting height of the component
nToWidthNumberchecked0 Destination width of the component
nToHeightNumberchecked0 Destination height of the component

Return Type

void

Static Method Details

createNormalResize

Static convenience method that resizes one component and then stops.
Autostarts and autodisposes itself.

Syntax

BiSizeAnimator . createNormalResize ( [ nFromWidth [ ,nFromHeight [ ,nToWidth [ ,nToHeight,oComp [ ,nSpeed ] ] ] ] ] )

Parameters

NameTypeOptionalDefaultDescripton
nFromWidthNumberchecked0 Starting width of the component
nFromHeightNumberchecked0 Starting height of the component
nToWidthNumberchecked0 Destination width of the component
nToHeightNumberchecked0 Destination height of the component
oCompBiComponentA component to animate
nSpeedNumbercheckedBiSizeAnimator.SPEED4 The desired time/length of the animation, measured in milliseconds

Return Type

void

createSmoothResize

Static convenience method that resizes one component and then stops.
Autostarts and autodisposes itself.

Syntax

BiSizeAnimator . createSmoothResize ( [ nFromWidth [ ,nFromHeight [ ,nToWidth [ ,nToHeight,oComp [ ,nSpeed ] ] ] ] ] )

Parameters

NameTypeOptionalDefaultDescripton
nFromWidthNumberchecked0 Starting width of the component
nFromHeightNumberchecked0 Starting height of the component
nToWidthNumberchecked0 Destination width of the component
nToHeightNumberchecked0 Destination height of the component
oCompBiComponentA component to animate
nSpeedNumbercheckedBiSizeAnimator.SPEED4 The desired time/length of the animation, measured in milliseconds

Return Type

void