parallaxis/voices/js/greensock-v12-js/docs/com/greensock/easing/SteppedEase.html

53 lines
9.4 KiB
HTML
Executable File

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><!-- saved from url=(0014)about:internet --><html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><link rel="stylesheet" href="../../../style.css" type="text/css" media="screen"><link rel="stylesheet" href="../../../print.css" type="text/css" media="print"><link rel="stylesheet" href="../../../override.css" type="text/css"><meta name="keywords" content="SteppedEase,com.greensock.easing.SteppedEase,config,config,find,getRatio,getRatio,getRatio"><title>com.greensock.easing.SteppedEase</title></head><body><script language="javascript" type="text/javascript" src="../../../asdoc.js"></script><script language="javascript" type="text/javascript" src="../../../help.js"></script><script language="javascript" type="text/javascript" src="../../../cookies.js"></script><script language="javascript" type="text/javascript"><!--
asdocTitle = 'SteppedEase - GreenSock JavaScript Documentation';
var baseRef = '../../../';
window.onload = configPage;
--></script>
<script type="text/javascript">
scrollToNameAnchor();
</script><table class="titleTable" cellpadding="0" cellspacing="0" id="titleTable" style="display:none"><tr><td class="titleTableTitle" align="left">GreenSock JavaScript API Docs</td><td class="titleTableTopNav" align="right"><a href="../../../package-summary.html" onclick="loadClassListFrame('../../../all-classes.html')">All Packages</a>&nbsp;|&nbsp;<a href="../../../class-summary.html" onclick="loadClassListFrame('../../../all-classes.html')">All Classes</a>&nbsp;|&nbsp;<a href="../../../all-index-A.html" onclick="loadClassListFrame('../../../index-list.html')">Index</a>&nbsp;|&nbsp;<a id="framesLink1" href="../../../index.html?com/greensock/easing/SteppedEase.html&amp;com/greensock/easing/class-list.html">Frames</a><a id="noFramesLink1" style="display:none" href="" onclick="parent.location=document.location"> No Frames </a></td><td class="titleTableLogo" align="right" rowspan="3"><img src="../../../images/logo.jpg" class="logoImage" alt=" Adobe Logo " title=" Adobe Logo "></td></tr><tr class="titleTableRow2"><td class="titleTableSubTitle" id="subTitle" align="left">SteppedEase</td><td class="titleTableSubNav" id="subNav" align="right"><a href="#methodSummary">Methods</a></td></tr><tr class="titleTableRow3"><td colspan="3">&nbsp;</td></tr></table><script language="javascript" type="text/javascript" xml:space="preserve">
<!--
if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME) {titleBar_setSubTitle("SteppedEase"); titleBar_setSubNav(false,false,false,false,false,false,false,false,true,false,false ,false,false,false,false,false);}
-->
</script><div xmlns:fn="http://www.w3.org/2005/xpath-functions" class="MainContent"><table class="classHeaderTable" cellpadding="0" cellspacing="0"><tr><td class="classHeaderTableLabel">Package</td><td><a href="package-detail.html" onclick="javascript:loadClassListFrame('class-list.html')">com.greensock.easing</a></td></tr><tr><td class="classHeaderTableLabel">Class</td><td class="classSignature">public class SteppedEase</td></tr><tr><td class="classHeaderTableLabel">Inheritance</td><td class="inheritanceList">SteppedEase <img src="../../../images/inherit-arrow.gif" title="Inheritance" alt="Inheritance" class="inheritArrow"> <a href="../../../com/greensock/easing/Ease.html">Ease</a> <img src="../../../images/inherit-arrow.gif" title="Inheritance" alt="Inheritance" class="inheritArrow"> Object</td></tr></table><p></p><p></p><p></p>
Most easing equations give a smooth, gradual transition between the start and end values, but SteppedEase provides
an easy way to define a specific number of steps that the transition should take. For example, if mc.x is 0 and you
want to tween it to 100 with 5 steps (20, 40, 60, 80, and 100) over the course of 2 seconds, you'd do:
<div class="listing" version="3.0"><pre>
TweenLite.to(mc, 2, {x:100, ease:SteppedEase.config(5)});
//or create an instance directly
var steppedEase = new SteppedEase(5);
TweenLite.to(mc, 3, {y:300, ease:steppedEase});
</pre></div>
<p>Note: SteppedEase is optimized for use with the GreenSock tweenining platform, so it isn't intended to be used with other engines.
Specifically, its easing equation always returns values between 0 and 1.</p>
<p>
<b>Copyright 2008-2012, GreenSock. All rights reserved.</b> This work is subject to the terms in <a href="http://www.greensock.com/terms_of_use.html" target="">http://www.greensock.com/terms_of_use.html</a> or for <a href="http://www.greensock.com/club/" target="">Club GreenSock</a> members, the software agreement that was issued with the membership.</p>
<p></p><br/><hr></div><a name="methodSummary"></a><div class="summarySection"><div class="summaryTableTitle">Public Methods </div><table cellspacing="0" cellpadding="3" class="summaryTable " id="summaryTableMethod"><tr><th>&nbsp;</th><th colspan="2">Method</th><th class="summaryTableOwnerCol">Defined By</th></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#SteppedEase()" class="signatureLink">SteppedEase</a>(steps:int)</div><div class="summaryTableDescription">
Constructor
</div></td><td class="summaryTableOwnerCol">SteppedEase</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#config()" class="signatureLink">config</a>(steps:int):<a href="../../../com/greensock/easing/SteppedEase.html">SteppedEase</a></div><div class="summaryTableDescription">[static]
Permits customization of the ease (defining a number of steps).</div></td><td class="summaryTableOwnerCol">SteppedEase</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#getRatio()" class="signatureLink">getRatio</a>(p:Number):Number</div><div class="summaryTableDescription">[override]
Translates the tween's progress ratio into the corresponding ease ratio.</div></td><td class="summaryTableOwnerCol">SteppedEase</td></tr></table></div><script language="javascript" type="text/javascript"><!--
showHideInherited();
--></script><div class="MainContent"><a name="constructorDetail"></a><div class="detailSectionHeader">Constructor Detail</div><a name="SteppedEase()"></a><a name="SteppedEase(int)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">SteppedEase</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">Constructor</td></tr></table><div class="detailBody"><code>public function SteppedEase(steps:int)</code><p></p><p>
Constructor
</p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">steps</span>:int</code> &mdash; Number of steps between the start and the end values.
</td></tr></table></div><a name="methodDetail"></a><div class="detailSectionHeader">Method Detail</div><a name="config()"></a><a name="config(int)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">config</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td></tr></table><div class="detailBody"><code> public static function config(steps:int):<a href="../../../com/greensock/easing/SteppedEase.html">SteppedEase</a></code><p></p><p></p><p>
Permits customization of the ease (defining a number of steps).
</p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">steps</span>:int</code> &mdash; Number of steps between the start and the end values.
</td></tr></table></p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="../../../com/greensock/easing/SteppedEase.html">SteppedEase</a></code> &mdash; new SteppedEase instance that is configured according to the parameters provided
</td></tr></table></div><a name="getRatio()"></a><a name="getRatio(Number)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">getRatio</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code>override public function getRatio(p:Number):Number</code><p></p><p></p><p>
Translates the tween's progress ratio into the corresponding ease ratio. This is the heart of the Ease, where it does all its work.
</p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">p</span>:Number</code> &mdash; progress ratio (a value between 0 and 1 indicating the progress of the tween/ease)
</td></tr></table></p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code>Number</code> &mdash; translated number
</td></tr></table></div><br/><br/><hr><br/><p></p><center class="copyright"><footer></footer><br/>Thu Dec 20 2012, 04:30 PM -06:00 </center></div></body></html><!--<br/>Thu Dec 20 2012, 04:30 PM -06:00 -->