Package | com.greensock.easing |
Class | public class RoughEase |
Inheritance | RoughEase ![]() ![]() |
Linear.easeNone
)1
)20
)clamp
to true
will prevent 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
clamp
is true
, but if it is false
, x could potentially jump
above 100 or below 0 at some point during the tween (it would always end at 100 though in this example)
(Default: false
)."in" | "out" | "both" | "none"
) - to make the strength of the
roughness taper towards the end or beginning or both, use "out"
, "in"
,
or "both"
respectively. (Default: "none"
)randomize
to false
to make the points zig-zag evenly across the ease.
Using this in conjunction with a taper
value can create a nice effect. (Default: true
)For a visual example and more details, check out http://www.greensock.com/roughease/.
Example code
import com.greensock.TweenLite; import com.greensock.easing.*; //use the default values TweenLite.from(mc, 3, {alpha:0, ease:RoughEase.ease}); //or customize the configuration TweenLite.to(mc, 3, {y:300, ease:RoughEase.ease.config({strength:3, points:50, template:Strong.easeInOut, taper:"both", randomize:false}) }); //or create a RoughEase that we can pass in to multiple tweens later var rough:RoughEase = new RoughEase({strength:3, points:50, template:Strong.easeInOut, taper:"both", randomize:false}); TweenLite.to(mc, 3, {y:300, ease:rough}); TweenLite.to(mc2, 5, {x:500, ease:rough});
Copyright 2010-2013, GreenSock. All rights reserved. This work is subject to the terms in http://www.greensock.com/terms_of_use.html or for Club GreenSock members, the software agreement that was issued with the membership.
Property | Defined By | ||
---|---|---|---|
ease : RoughEase [static] The default ease instance which can be reused many times in various tweens in order to conserve memory and improve performance slightly compared to creating a new instance each time. | RoughEase |
Method | Defined By | ||
---|---|---|---|
RoughEase(vars:* = null, ... args)
Constructor
| RoughEase | ||
Permits customization of the ease with various parameters. | RoughEase | ||
getRatio(p:Number):Number [override]
Translates the tween's progress ratio into the corresponding ease ratio. | RoughEase |
ease | property |
public static var ease:RoughEase
The default ease instance which can be reused many times in various tweens in order to conserve memory and improve performance slightly compared to creating a new instance each time.
RoughEase | () | Constructor |
public function RoughEase(vars:* = null, ... args)
Constructor
Parametersvars:* (default = null ) — a generic object with any of the following properties (all are completely optional):
| |
... args |
config | () | method |
public function config(vars:Object = null):RoughEase
Permits customization of the ease with various parameters.
Parameters
vars:Object (default = null ) — a generic object with any of the following properties (all are completely optional):
|
RoughEase — new RoughEase instance that is configured according to the parameters provided
|
getRatio | () | method |
override public function getRatio(p:Number):Number
Translates the tween's progress ratio into the corresponding ease ratio. This is the heart of the Ease, where it does all its work.
Parameters
p:Number — progress ratio (a value between 0 and 1 indicating the progress of the tween/ease)
|
Number — translated number
|