Package | com.greensock.easing |
Class | public class RoughEase |
import com.greensock.TweenLite;
import com.greensock.easing.RoughEase;
TweenLite.from(mc, 3, {alpha:0, ease:RoughEase.create(1, 15)});
//or create an instance directly
var rough:RoughEase = new RoughEase(1.5, 30, true, Strong.easeOut, "none", true, "superRoughEase");
TweenLite.to(mc, 3, {y:300, ease:rough.ease});
//and later, you can find the ease by name like:
TweenLite.to(mc, 3, {y:300, ease:RoughEase.byName("superRoughEase")});
Property | Defined by | ||
---|---|---|---|
name : String name of the RoughEase instance
| RoughEase |
Method | Defined by | ||
---|---|---|---|
RoughEase(strength:Number = 1, points:uint = 20, restrictMaxAndMin:Boolean = false, templateEase:Function = null, taper:String = "none", randomize:Boolean = true, name:String = "")
Constructor
| RoughEase | ||
byName(name:String):Function
[static]
Provides a quick way to look up a RoughEase by its name.
| RoughEase | ||
create(strength:Number = 1, points:uint = 20, restrictMaxAndMin:Boolean = false, templateEase:Function = null, taper:String = "none", randomize:Boolean = true, name:String = ""):Function
[static]
This static function provides a quick way to create a RoughEase and immediately reference its ease function
in a tween, like:
TweenLite.from(mc, 2, {alpha:0, ease:RoughEase.create(1.5, 15)});
| RoughEase | ||
dispose():void
Disposes the RoughEase so that it is no longer stored for easy lookups by name with
byName() , releasing it for garbage collection. | RoughEase | ||
ease(t:Number, b:Number, c:Number, d:Number):Number
Easing function that interpolates the numbers
| RoughEase |
name | property |
name:String
[read-write]name of the RoughEase instance
Implementation public function get name():String
public function set name(value:String):void
RoughEase | () | constructor |
public function RoughEase(strength:Number = 1, points:uint = 20, restrictMaxAndMin:Boolean = false, templateEase:Function = null, taper:String = "none", randomize:Boolean = true, name:String = "")
Constructor
Parametersstrength:Number (default = 1 ) — amount of variance from the templateEase (Linear.easeNone by default) that each random point can be placed. A low number like 0.1 will hug very closely to the templateEase whereas a larger number like 2 will allow the values to wander further away from the templateEase.
|
|
points:uint (default = 20 ) — quantity of random points to plot in the ease. A larger number will cause more (and quicker) flickering.
|
|
restrictMaxAndMin:Boolean (default = false ) — If true, the ease will prevent random points from exceeding the end value or dropping below the starting value. For example, if you're tweening the x property from 0 to 100, the RoughEase would force all random points to stay between 0 and 100 if restrictMaxAndMin is true, but if it is false, a x could potentially jump above 100 or below 0 at some point during the tween (it would always end at 100 though).
|
|
templateEase:Function (default = null ) — an easing equation that should be used as a template or guide. Then random points are plotted at a certain distance away from the templateEase (based on the strength parameter). The default is Linear.easeNone.
|
|
taper:String (default = "none ") — to make the strength of the roughness taper towards the end or beginning or both, use "out", "in", or "both" respectively here (default is "none").
|
|
randomize:Boolean (default = true ) — to randomize the placement of the points, set randomize to true (otherwise the points will zig-zag evenly across the ease)
|
|
name:String (default = " ") — a name to associate with the ease so that you can use RoughEase.byName() to look it up later. Of course you should always make sure you use a unique name for each ease (if you leave it blank, a name will automatically be generated).
|
byName | () | method |
public static function byName(name:String):Function
Provides a quick way to look up a RoughEase by its name.
Parametersname:String — the name of the RoughEase
|
Function — easing function from the RoughEase associated with the name
|
create | () | method |
public static function create(strength:Number = 1, points:uint = 20, restrictMaxAndMin:Boolean = false, templateEase:Function = null, taper:String = "none", randomize:Boolean = true, name:String = ""):Function
This static function provides a quick way to create a RoughEase and immediately reference its ease function
in a tween, like:
TweenLite.from(mc, 2, {alpha:0, ease:RoughEase.create(1.5, 15)});
strength:Number (default = 1 ) — amount of variance from the templateEase (Linear.easeNone by default) that each random point can be placed. A low number like 0.1 will hug very closely to the templateEase whereas a larger number like 2 will allow the values to wander further away from the templateEase.
|
|
points:uint (default = 20 ) — quantity of random points to plot in the ease. A larger number will cause more (and quicker) flickering.
|
|
restrictMaxAndMin:Boolean (default = false ) — If true, the ease will prevent random points from exceeding the end value or dropping below the starting value. For example, if you're tweening the x property from 0 to 100, the RoughEase would force all random points to stay between 0 and 100 if restrictMaxAndMin is true, but if it is false, a x could potentially jump above 100 or below 0 at some point during the tween (it would always end at 100 though).
|
|
templateEase:Function (default = null ) — an easing equation that should be used as a template or guide. Then random points are plotted at a certain distance away from the templateEase (based on the strength parameter). The default is Linear.easeNone.
|
|
taper:String (default = "none ") — to make the strength of the roughness taper towards the end or beginning or both, use "out", "in", or "both" respectively here (default is "none").
|
|
randomize:Boolean (default = true ) — to randomize the placement of the points, set randomize to true (otherwise the points will zig-zag evenly across the ease)
|
|
name:String (default = " ") — a name to associate with the ease so that you can use RoughEase.byName() to look it up later. Of course you should always make sure you use a unique name for each ease (if you leave it blank, a name will automatically be generated).
|
Function — easing function
|
dispose | () | method |
public function dispose():void
Disposes the RoughEase so that it is no longer stored for easy lookups by name with byName()
, releasing it for garbage collection.
ease | () | method |
public function ease(t:Number, b:Number, c:Number, d:Number):Number
Easing function that interpolates the numbers
Parameterst:Number — time
|
|
b:Number — start
|
|
c:Number — change
|
|
d:Number — duration
|
Number — Result of the ease
|