Class sandy.util.Ease

Description

The Ease class is used to create functions that add an easing to a number value or percentage. Functions created take one numeric parameter t (0-1) and returns an eased version of that value. There are two kinds of Ease methods that are used to define Ease instances. The first are ease method methods, those which affect the actual ease behavior (ease 'method'). These include methods like sin and circular. The others define the ease type. These are Ease methods that start with 'easing' and determine whether or not an ease eases in or out or a combination of either. These methods include easingIn and easingInToBackOut.

Field Index

method, type, version

Method Index

new Ease()
bounce(), call(), circular(), compound(), create(), cubicBezier(), easingIn(), easingInToBackIn(), easingInToBackOut(), easingInToIn(), easingInToOut(), easingOut(), easingOutToBackIn(), easingOutToBackOut(), easingOutToIn(), easingOutToOut(), elastic(), exponential(), exponentialAnticipate(), linear(), quadraticBezier(), sin(), sinAnticipate()

Constructor Detail

Ease

public function Ease(Void)

Constructor: Creates an Ease instance.

Field Detail

version

static public version:String

method

public method:Function
Easing method.

type

public type:Function
Ease type (in or out)

Method Detail

compound

static public function compound():Function

Compounds multiple ease functions to be called in sequential order as one function

Parameters

Return

A new easing function which will call each function passed in, evenly distributed, in sequential order.

create

public function create(f:Object):Function

Creates a function reflective of the easing applied to the Ease instance. The function accepts one parameter, t:Number, and returns the eased version of its value when called. This function mimics the call() method of Ease.

Parameters

fAn additional function the returned function can wrap

Return

A function which applies a tween to a number passed into it when called.

call

public function call(t:Number):Number

Applies Easing as defined by the Ease instance to the value passed.

Parameters

tA value 0-1 which is to have easing applied to it

Return

The eased version of the number passed.

easingIn

public function easingIn(a:Number):Ease

Modifies the Ease to ease in by a specified amount

Parameters

aAmount of easing applied to the ease

Return

The current Ease instance

easingOut

public function easingOut(a:Number):Ease

Modifies the Ease to ease out by a specified amount

Parameters

aAmount of easing applied to the ease

Return

The current Ease instance

easingInToIn

public function easingInToIn(a:Number, c:Number):Ease

Modifies the Ease to apply two easing in eases in succession

Parameters

aAmount of easing applied to the ease
cThe point at which the first ease changes to the next in percent)

Return

The current Ease instance

easingInToOut

public function easingInToOut(a:Number, c:Number):Ease

Modifies the Ease to apply two eases in succession, the first easing in, the second easing out

Parameters

aAmount of easing applied to the ease
cThe point at which the first ease changes to the next in percent)

Return

The current Ease instance

easingOutToOut

public function easingOutToOut(a:Number, c:Number):Ease

Modifies the Ease to apply two easing out eases in succession

Parameters

aAmount of easing applied to the ease
cThe point at which the first ease changes to the next in percent)

Return

The current Ease instance

easingOutToIn

public function easingOutToIn(a:Number, c:Number):Ease

Modifies the Ease to apply two eases in succession, the first easing out, the second easing in

Parameters

aAmount of easing applied to the ease
cThe point at which the first ease changes to the next in percent)

Return

The current Ease instance

easingInToBackIn

public function easingInToBackIn(a:Number, c:Number):Ease

Modifies the Ease to apply two eases in succession, the first easing all the way in, the second easing in back to the the ease start

Parameters

aAmount of easing applied to the ease
cThe point at which the first ease changes to the next in percent)

Return

The current Ease instance

easingInToBackOut

public function easingInToBackOut(a:Number, c:Number):Ease

Modifies the Ease to apply two eases in succession, the first easing all the way in, the second easing out back to the the ease start

Parameters

aAmount of easing applied to the ease
cThe point at which the first ease changes to the next in percent)

Return

The current Ease instance

easingOutToBackOut

public function easingOutToBackOut(a:Number, c:Number):Ease

Modifies the Ease to apply two eases in succession, the first easing all the way out, the second easing out back to the the ease start

Parameters

aAmount of easing applied to the ease
cThe point at which the first ease changes to the next in percent)

Return

The current Ease instance

easingOutToBackIn

public function easingOutToBackIn(a:Number, c:Number):Ease

Modifies the Ease to apply two eases in succession, the first easing all the way out, the second easing out in to the the ease start

Parameters

aAmount of easing applied to the ease
cThe point at which the first ease changes to the next in percent)

Return

The current Ease instance

linear

public function linear(Void):Ease

Modifies the Ease to apply linear easing (no easing)

Return

The current Ease instance

exponential

public function exponential(p:Number):Ease

Modifies the Ease to apply exponential easing

Parameters

pThe exponential power of the easing; the higher the greater the ease

Return

The current Ease instance

exponentialAnticipate

public function exponentialAnticipate(p:Number, a:Number):Ease

Modifies the Ease to apply exponential easing with anticipation (backing up before going forward)

Parameters

pThe exponential power of the easing; the higher the greater the ease
a(Optional) The anticipation percent factor. The greater, the more the anticipation. Default: .5.

Return

The current Ease instance

sin

public function sin(Void):Ease

Modifies the Ease to apply easing based on the sine curve

Parameters

Return

The current Ease instance

sinAnticipate

public function sinAnticipate(a:Number):Ease

Modifies the Ease to apply easing based on the sine curve with anticipation (backing up before going forward)

Parameters

a(Optional) The anticipation percent factor. The greater, the more the anticipation. Default: .5.

Return

The current Ease instance

circular

public function circular(Void):Ease

Modifies the Ease to apply circular easing

Parameters

Return

The current Ease instance

quadraticBezier

public function quadraticBezier(c:Number):Ease

Modifies the Ease to apply easing based on a quadratic bezier curve

Parameters

c(Optional) Control point placement along 0-1. Default .5.

Return

The current Ease instance

cubicBezier

public function cubicBezier(c1:Number, c2:Number):Ease

Modifies the Ease to apply easing based on a quadratic bezier curve

Parameters

c1(Optional) First ontrol point placement along 0-1. Default .25.
c2(Optional) Second ontrol point placement along 0-1. Default .75.

Return

The current Ease instance

bounce

public function bounce(b:Number, r:Number, e:Object):Ease

Modifies the Ease to apply a bouncing effect

Parameters

b(Optional) The number of bounces. Default 1.
r(Optional) The reduction applied to sequential bounces 0-1. Default 1.
e(Optional) An Ease instance or ease function to be used for the bounces Default (exponential).

Return

The current Ease instance

elastic

public function elastic(b:Number, r:Number, e:Object):Ease

Modifies the Ease to apply an elastic effect

Parameters

b(Optional) The number of bounces. Default 1.
r(Optional) The reduction applied to sequential bounces 0-1. Default 1.
e(Optional) An Ease instance or ease function to be used for the bounces Default (exponential).

Return

The current Ease instance