UNPKG

starling-framework

Version:

A fast, productive library for 2D cross-platform development.

875 lines 56.2 kB
<!doctype html> <html class="default no-js"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>Juggler | starling-framework</title> <meta name="description" content=""> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="../assets/css/main.css"> </head> <body> <header> <div class="tsd-page-toolbar"> <div class="container"> <div class="table-wrap"> <div class="table-cell" id="tsd-search" data-index="../assets/js/search.js" data-base=".."> <div class="field"> <label for="tsd-search-field" class="tsd-widget search no-caption">Search</label> <input id="tsd-search-field" type="text" /> </div> <ul class="results"> <li class="state loading">Preparing search index...</li> <li class="state failure">The search index is not available</li> </ul> <a href="../index.html" class="title">starling-framework</a> </div> <div class="table-cell" id="tsd-widgets"> <div id="tsd-filter"> <a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a> <div class="tsd-filter-group"> <div class="tsd-select" id="tsd-filter-visibility"> <span class="tsd-select-label">All</span> <ul class="tsd-select-list"> <li data-value="public">Public</li> <li data-value="protected">Public/Protected</li> <li data-value="private" class="selected">All</li> </ul> </div> <input type="checkbox" id="tsd-filter-inherited" checked /> <label class="tsd-widget" for="tsd-filter-inherited">Inherited</label> <input type="checkbox" id="tsd-filter-externals" checked /> <label class="tsd-widget" for="tsd-filter-externals">Externals</label> <input type="checkbox" id="tsd-filter-only-exported" /> <label class="tsd-widget" for="tsd-filter-only-exported">Only exported</label> </div> </div> <a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a> </div> </div> </div> </div> <div class="tsd-page-title"> <div class="container"> <ul class="tsd-breadcrumb"> <li> <a href="../index.html">starling</a> </li> <li> <a href="../modules/starling.animation.html">animation</a> </li> <li> <a href="starling.animation.juggler.html">Juggler</a> </li> </ul> <h1>Class Juggler</h1> </div> </div> </header> <div class="container container-main"> <div class="row"> <div class="col-8 col-content"> <section class="tsd-panel tsd-comment"> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>The Juggler takes objects that implement IAnimatable (like Tweens) and executes them.</p> </div> <p>A juggler is a simple object. It does no more than saving a list of objects implementing &quot;IAnimatable&quot; and advancing their time if it is told to do so (by calling its own &quot;advanceTime&quot;-method). When an animation is completed, it throws it away.</p> <p>There is a default juggler available at the Starling class:</p> <pre> juggler:Juggler = Starling.juggler; </pre> <p>You can create juggler objects yourself, just as well. That way, you can group your game into logical components that handle their animations independently. All you have to do is call the &quot;advanceTime&quot; method on your custom juggler once per frame.</p> <p>Another handy feature of the juggler is the &quot;delayCall&quot;-method. Use it to execute a at a later time. Different to conventional approaches, the method will only be called when the juggler is advanced, giving you perfect control over the call.</p> <pre> juggler.delayCall(object.removeFromParent, 1.0); juggler.delayCall(object.addChild, 2.0, theChild); juggler.delayCall(function():void { rotation += 0.1; }, 3.0); </pre> <p> @see Tween @see DelayedCall</p> </div> </section> <section class="tsd-panel tsd-hierarchy"> <h3>Hierarchy</h3> <ul class="tsd-hierarchy"> <li> <span class="target">Juggler</span> </li> </ul> </section> <section class="tsd-panel"> <h3>Implements</h3> <ul class="tsd-hierarchy"> <li><a href="starling.animation.ianimatable.html" class="tsd-signature-type">IAnimatable</a></li> </ul> </section> <section class="tsd-panel-group tsd-index-group"> <h2>Index</h2> <section class="tsd-panel tsd-index-panel"> <div class="tsd-index-content"> <section class="tsd-index-section tsd-is-external"> <h3>Constructors</h3> <ul class="tsd-index-list"> <li class="tsd-kind-constructor tsd-parent-kind-class tsd-is-external"><a href="starling.animation.juggler.html#constructor" class="tsd-kind-icon">constructor</a></li> </ul> </section> <section class="tsd-index-section tsd-is-external"> <h3>Properties</h3> <ul class="tsd-index-list"> <li class="tsd-kind-property tsd-parent-kind-class tsd-is-external"><a href="starling.animation.juggler.html#elapsedtime" class="tsd-kind-icon">elapsed<wbr>Time</a></li> <li class="tsd-kind-property tsd-parent-kind-class tsd-is-protected tsd-is-external"><a href="starling.animation.juggler.html#objects" class="tsd-kind-icon">objects</a></li> <li class="tsd-kind-property tsd-parent-kind-class tsd-is-external"><a href="starling.animation.juggler.html#timescale" class="tsd-kind-icon">time<wbr>Scale</a></li> </ul> </section> <section class="tsd-index-section tsd-is-external"> <h3>Methods</h3> <ul class="tsd-index-list"> <li class="tsd-kind-method tsd-parent-kind-class tsd-is-external"><a href="starling.animation.juggler.html#add" class="tsd-kind-icon">add</a></li> <li class="tsd-kind-method tsd-parent-kind-class tsd-is-external"><a href="starling.animation.juggler.html#addwithid" class="tsd-kind-icon">add<wbr>WithID</a></li> <li class="tsd-kind-method tsd-parent-kind-class tsd-is-external"><a href="starling.animation.juggler.html#advancetime" class="tsd-kind-icon">advance<wbr>Time</a></li> <li class="tsd-kind-method tsd-parent-kind-class tsd-is-external"><a href="starling.animation.juggler.html#contains" class="tsd-kind-icon">contains</a></li> <li class="tsd-kind-method tsd-parent-kind-class tsd-is-external"><a href="starling.animation.juggler.html#containsdelayedcalls" class="tsd-kind-icon">contains<wbr>Delayed<wbr>Calls</a></li> <li class="tsd-kind-method tsd-parent-kind-class tsd-is-external"><a href="starling.animation.juggler.html#containstweens" class="tsd-kind-icon">contains<wbr>Tweens</a></li> <li class="tsd-kind-method tsd-parent-kind-class tsd-is-external"><a href="starling.animation.juggler.html#delaycall" class="tsd-kind-icon">delay<wbr>Call</a></li> <li class="tsd-kind-method tsd-parent-kind-class tsd-is-protected tsd-is-external"><a href="starling.animation.juggler.html#get_elapsedtime" class="tsd-kind-icon">get_<wbr>elapsed<wbr>Time</a></li> <li class="tsd-kind-method tsd-parent-kind-class tsd-is-protected tsd-is-external"><a href="starling.animation.juggler.html#get_objects" class="tsd-kind-icon">get_<wbr>objects</a></li> <li class="tsd-kind-method tsd-parent-kind-class tsd-is-protected tsd-is-external"><a href="starling.animation.juggler.html#get_timescale" class="tsd-kind-icon">get_<wbr>time<wbr>Scale</a></li> <li class="tsd-kind-method tsd-parent-kind-class tsd-is-external"><a href="starling.animation.juggler.html#purge" class="tsd-kind-icon">purge</a></li> <li class="tsd-kind-method tsd-parent-kind-class tsd-is-external"><a href="starling.animation.juggler.html#remove" class="tsd-kind-icon">remove</a></li> <li class="tsd-kind-method tsd-parent-kind-class tsd-is-external"><a href="starling.animation.juggler.html#removebyid" class="tsd-kind-icon">remove<wbr>ByID</a></li> <li class="tsd-kind-method tsd-parent-kind-class tsd-is-external"><a href="starling.animation.juggler.html#removedelayedcalls" class="tsd-kind-icon">remove<wbr>Delayed<wbr>Calls</a></li> <li class="tsd-kind-method tsd-parent-kind-class tsd-is-external"><a href="starling.animation.juggler.html#removetweens" class="tsd-kind-icon">remove<wbr>Tweens</a></li> <li class="tsd-kind-method tsd-parent-kind-class tsd-is-external"><a href="starling.animation.juggler.html#repeatcall" class="tsd-kind-icon">repeat<wbr>Call</a></li> <li class="tsd-kind-method tsd-parent-kind-class tsd-is-protected tsd-is-external"><a href="starling.animation.juggler.html#set_timescale" class="tsd-kind-icon">set_<wbr>time<wbr>Scale</a></li> <li class="tsd-kind-method tsd-parent-kind-class tsd-is-external"><a href="starling.animation.juggler.html#tween" class="tsd-kind-icon">tween</a></li> </ul> </section> </div> </section> </section> <section class="tsd-panel-group tsd-member-group tsd-is-external"> <h2>Constructors</h2> <section class="tsd-panel tsd-member tsd-kind-constructor tsd-parent-kind-class tsd-is-external"> <a name="constructor" class="tsd-anchor"></a> <h3>constructor</h3> <ul class="tsd-signatures tsd-kind-constructor tsd-parent-kind-class tsd-is-external"> <li class="tsd-signature tsd-kind-icon">new <wbr>Juggler<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="starling.animation.juggler.html" class="tsd-signature-type">Juggler</a></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/openfl/starling/blob/bce2af2/lib/starling/animation/Juggler.d.ts#L37">lib/starling/animation/Juggler.d.ts:37</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Create an empty juggler.</p> </div> </div> <h4 class="tsd-returns-title">Returns <a href="starling.animation.juggler.html" class="tsd-signature-type">Juggler</a></h4> </li> </ul> </section> </section> <section class="tsd-panel-group tsd-member-group tsd-is-external"> <h2>Properties</h2> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-external"> <a name="elapsedtime" class="tsd-anchor"></a> <h3>elapsed<wbr>Time</h3> <div class="tsd-signature tsd-kind-icon">elapsed<wbr>Time<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/openfl/starling/blob/bce2af2/lib/starling/animation/Juggler.d.ts#L143">lib/starling/animation/Juggler.d.ts:143</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>The total life time of the juggler (in seconds).</p> </div> </div> </section> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-protected tsd-is-external"> <a name="objects" class="tsd-anchor"></a> <h3><span class="tsd-flag ts-flagProtected">Protected</span> objects</h3> <div class="tsd-signature tsd-kind-icon">objects<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Vector</span><span class="tsd-signature-symbol">&lt;</span><a href="starling.animation.ianimatable.html" class="tsd-signature-type">IAnimatable</a><span class="tsd-signature-symbol">&gt;</span></div> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/openfl/starling/blob/bce2af2/lib/starling/animation/Juggler.d.ts#L154">lib/starling/animation/Juggler.d.ts:154</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>The actual vector that contains all objects that are currently being animated.</p> </div> </div> </section> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-external"> <a name="timescale" class="tsd-anchor"></a> <h3>time<wbr>Scale</h3> <div class="tsd-signature tsd-kind-icon">time<wbr>Scale<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/openfl/starling/blob/bce2af2/lib/starling/animation/Juggler.d.ts#L149">lib/starling/animation/Juggler.d.ts:149</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>The scale at which the time is passing. This can be used for slow motion or time laps effects. Values below &#39;1&#39; will make all animations run slower, values above &#39;1&#39; faster. @default 1.0</p> </div> </div> </section> </section> <section class="tsd-panel-group tsd-member-group tsd-is-external"> <h2>Methods</h2> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-external"> <a name="add" class="tsd-anchor"></a> <h3>add</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-external"> <li class="tsd-signature tsd-kind-icon">add<span class="tsd-signature-symbol">(</span>object<span class="tsd-signature-symbol">: </span><a href="starling.animation.ianimatable.html" class="tsd-signature-type">IAnimatable</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/openfl/starling/blob/bce2af2/lib/starling/animation/Juggler.d.ts#L46">lib/starling/animation/Juggler.d.ts:46</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Adds an object to the juggler.</p> </div> <p> @return Unique numeric identifier for the animation. This identifier may be used to remove the object via <code>removeByID()</code>.</p> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>object: <a href="starling.animation.ianimatable.html" class="tsd-signature-type">IAnimatable</a></h5> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-external"> <a name="addwithid" class="tsd-anchor"></a> <h3>add<wbr>WithID</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-external"> <li class="tsd-signature tsd-kind-icon">add<wbr>WithID<span class="tsd-signature-symbol">(</span>object<span class="tsd-signature-symbol">: </span><a href="starling.animation.ianimatable.html" class="tsd-signature-type">IAnimatable</a>, objectID<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/openfl/starling/blob/bce2af2/lib/starling/animation/Juggler.d.ts#L48">lib/starling/animation/Juggler.d.ts:48</a></li> </ul> </aside> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>object: <a href="starling.animation.ianimatable.html" class="tsd-signature-type">IAnimatable</a></h5> </li> <li> <h5>objectID: <span class="tsd-signature-type">number</span></h5> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-external"> <a name="advancetime" class="tsd-anchor"></a> <h3>advance<wbr>Time</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-external"> <li class="tsd-signature tsd-kind-icon">advance<wbr>Time<span class="tsd-signature-symbol">(</span>time<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/openfl/starling/blob/bce2af2/lib/starling/animation/Juggler.d.ts#L140">lib/starling/animation/Juggler.d.ts:140</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Advances all objects by a certain time (in seconds).</p> </div> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>time: <span class="tsd-signature-type">number</span></h5> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-external"> <a name="contains" class="tsd-anchor"></a> <h3>contains</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-external"> <li class="tsd-signature tsd-kind-icon">contains<span class="tsd-signature-symbol">(</span>object<span class="tsd-signature-symbol">: </span><a href="starling.animation.ianimatable.html" class="tsd-signature-type">IAnimatable</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/openfl/starling/blob/bce2af2/lib/starling/animation/Juggler.d.ts#L51">lib/starling/animation/Juggler.d.ts:51</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Determines if an object has been added to the juggler.</p> </div> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>object: <a href="starling.animation.ianimatable.html" class="tsd-signature-type">IAnimatable</a></h5> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-external"> <a name="containsdelayedcalls" class="tsd-anchor"></a> <h3>contains<wbr>Delayed<wbr>Calls</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-external"> <li class="tsd-signature tsd-kind-icon">contains<wbr>Delayed<wbr>Calls<span class="tsd-signature-symbol">(</span>callback<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Function</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/openfl/starling/blob/bce2af2/lib/starling/animation/Juggler.d.ts#L83">lib/starling/animation/Juggler.d.ts:83</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Figures out if the juggler contains one or more delayed calls with a certain callback.</p> </div> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>callback: <span class="tsd-signature-type">Function</span></h5> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-external"> <a name="containstweens" class="tsd-anchor"></a> <h3>contains<wbr>Tweens</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-external"> <li class="tsd-signature tsd-kind-icon">contains<wbr>Tweens<span class="tsd-signature-symbol">(</span>target<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/openfl/starling/blob/bce2af2/lib/starling/animation/Juggler.d.ts#L80">lib/starling/animation/Juggler.d.ts:80</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Figures out if the juggler contains one or more tweens with a certain target.</p> </div> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>target: <span class="tsd-signature-type">any</span></h5> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-external"> <a name="delaycall" class="tsd-anchor"></a> <h3>delay<wbr>Call</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-external"> <li class="tsd-signature tsd-kind-icon">delay<wbr>Call<span class="tsd-signature-symbol">(</span>call<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Function</span>, delay<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, args<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">Array</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/openfl/starling/blob/bce2af2/lib/starling/animation/Juggler.d.ts#L95">lib/starling/animation/Juggler.d.ts:95</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Delays the execution of a until <code>delay</code> seconds have passed. This method provides a convenient alternative for creating and adding a DelayedCall manually.</p> </div> <p> @return Unique numeric identifier for the delayed call. This identifier may be used to remove the object via <code>removeByID()</code>.</p> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>call: <span class="tsd-signature-type">Function</span></h5> </li> <li> <h5>delay: <span class="tsd-signature-type">number</span></h5> </li> <li> <h5><span class="tsd-flag ts-flagOptional">Optional</span> args: <span class="tsd-signature-type">Array</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</span></h5> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-protected tsd-is-external"> <a name="get_elapsedtime" class="tsd-anchor"></a> <h3><span class="tsd-flag ts-flagProtected">Protected</span> get_<wbr>elapsed<wbr>Time</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-protected tsd-is-external"> <li class="tsd-signature tsd-kind-icon">get_<wbr>elapsed<wbr>Time<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/openfl/starling/blob/bce2af2/lib/starling/animation/Juggler.d.ts#L144">lib/starling/animation/Juggler.d.ts:144</a></li> </ul> </aside> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-protected tsd-is-external"> <a name="get_objects" class="tsd-anchor"></a> <h3><span class="tsd-flag ts-flagProtected">Protected</span> get_<wbr>objects</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-protected tsd-is-external"> <li class="tsd-signature tsd-kind-icon">get_<wbr>objects<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Vector</span><span class="tsd-signature-symbol">&lt;</span><a href="starling.animation.ianimatable.html" class="tsd-signature-type">IAnimatable</a><span class="tsd-signature-symbol">&gt;</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/openfl/starling/blob/bce2af2/lib/starling/animation/Juggler.d.ts#L155">lib/starling/animation/Juggler.d.ts:155</a></li> </ul> </aside> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Vector</span><span class="tsd-signature-symbol">&lt;</span><a href="starling.animation.ianimatable.html" class="tsd-signature-type">IAnimatable</a><span class="tsd-signature-symbol">&gt;</span></h4> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-protected tsd-is-external"> <a name="get_timescale" class="tsd-anchor"></a> <h3><span class="tsd-flag ts-flagProtected">Protected</span> get_<wbr>time<wbr>Scale</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-protected tsd-is-external"> <li class="tsd-signature tsd-kind-icon">get_<wbr>time<wbr>Scale<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/openfl/starling/blob/bce2af2/lib/starling/animation/Juggler.d.ts#L150">lib/starling/animation/Juggler.d.ts:150</a></li> </ul> </aside> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-external"> <a name="purge" class="tsd-anchor"></a> <h3>purge</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-external"> <li class="tsd-signature tsd-kind-icon">purge<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/openfl/starling/blob/bce2af2/lib/starling/animation/Juggler.d.ts#L86">lib/starling/animation/Juggler.d.ts:86</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Removes all objects at once.</p> </div> </div> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-external"> <a name="remove" class="tsd-anchor"></a> <h3>remove</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-external"> <li class="tsd-signature tsd-kind-icon">remove<span class="tsd-signature-symbol">(</span>object<span class="tsd-signature-symbol">: </span><a href="starling.animation.ianimatable.html" class="tsd-signature-type">IAnimatable</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/openfl/starling/blob/bce2af2/lib/starling/animation/Juggler.d.ts#L58">lib/starling/animation/Juggler.d.ts:58</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Removes an object from the juggler.</p> </div> <p> @return The (now meaningless) unique numeric identifier for the animation, or zero if the object was not found.</p> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>object: <a href="starling.animation.ianimatable.html" class="tsd-signature-type">IAnimatable</a></h5> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-external"> <a name="removebyid" class="tsd-anchor"></a> <h3>remove<wbr>ByID</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-external"> <li class="tsd-signature tsd-kind-icon">remove<wbr>ByID<span class="tsd-signature-symbol">(</span>objectID<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/openfl/starling/blob/bce2af2/lib/starling/animation/Juggler.d.ts#L71">lib/starling/animation/Juggler.d.ts:71</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Removes an object from the juggler, identified by the unique numeric identifier you received when adding it.</p> </div> <p>It&#39;s not uncommon that an animatable object is added to a juggler repeatedly, e.g. when using an object-pool. Thus, when using the <code>remove</code> method, you might accidentally remove an object that has changed its context. By using <code>removeByID</code> instead, you can be sure to avoid that, since the objectID will always be unique.</p> <p> @return if successful, the passed objectID; if the object was not found, zero.</p> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>objectID: <span class="tsd-signature-type">number</span></h5> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-external"> <a name="removedelayedcalls" class="tsd-anchor"></a> <h3>remove<wbr>Delayed<wbr>Calls</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-external"> <li class="tsd-signature tsd-kind-icon">remove<wbr>Delayed<wbr>Calls<span class="tsd-signature-symbol">(</span>callback<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Function</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/openfl/starling/blob/bce2af2/lib/starling/animation/Juggler.d.ts#L77">lib/starling/animation/Juggler.d.ts:77</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Removes all delayed and repeated calls with a certain callback.</p> </div> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>callback: <span class="tsd-signature-type">Function</span></h5> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-external"> <a name="removetweens" class="tsd-anchor"></a> <h3>remove<wbr>Tweens</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-external"> <li class="tsd-signature tsd-kind-icon">remove<wbr>Tweens<span class="tsd-signature-symbol">(</span>target<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/openfl/starling/blob/bce2af2/lib/starling/animation/Juggler.d.ts#L74">lib/starling/animation/Juggler.d.ts:74</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Removes all tweens with a certain target.</p> </div> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>target: <span class="tsd-signature-type">any</span></h5> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-external"> <a name="repeatcall" class="tsd-anchor"></a> <h3>repeat<wbr>Call</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-external"> <li class="tsd-signature tsd-kind-icon">repeat<wbr>Call<span class="tsd-signature-symbol">(</span>call<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Function</span>, interval<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, repeatCount<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span>, args<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">Array</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/openfl/starling/blob/bce2af2/lib/starling/animation/Juggler.d.ts#L103">lib/starling/animation/Juggler.d.ts:103</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Runs a at a specified interval (in seconds). A &#39;repeatCount&#39; of zero means that it runs indefinitely.</p> </div> <p> @return Unique numeric identifier for the delayed call. This identifier may be used to remove the object via <code>removeByID()</code>.</p> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>call: <span class="tsd-signature-type">Function</span></h5> </li> <li> <h5>interval: <span class="tsd-signature-type">number</span></h5> </li> <li> <h5><span class="tsd-flag ts-flagOptional">Optional</span> repeatCount: <span class="tsd-signature-type">number</span></h5> </li> <li> <h5><span class="tsd-flag ts-flagOptional">Optional</span> args: <span class="tsd-signature-type">Array</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</span></h5> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-protected tsd-is-external"> <a name="set_timescale" class="tsd-anchor"></a> <h3><span class="tsd-flag ts-flagProtected">Protected</span> set_<wbr>time<wbr>Scale</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-protected tsd-is-external"> <li class="tsd-signature tsd-kind-icon">set_<wbr>time<wbr>Scale<span class="tsd-signature-symbol">(</span>value<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/openfl/starling/blob/bce2af2/lib/starling/animation/Juggler.d.ts#L151">lib/starling/animation/Juggler.d.ts:151</a></li> </ul> </aside> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>value: <span class="tsd-signature-type">number</span></h5> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-external"> <a name="tween" class="tsd-anchor"></a> <h3>tween</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-external"> <li class="tsd-signature tsd-kind-icon">tween<span class="tsd-signature-symbol">(</span>target<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span>, time<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, properties<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/openfl/starling/blob/bce2af2/lib/starling/animation/Juggler.d.ts#L137">lib/starling/animation/Juggler.d.ts:137</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Utilizes a tween to animate the target object over <code>time</code> seconds. Internally, this method uses a tween instance (taken from an object pool) that is added to the juggler right away. This method provides a convenient alternative for creating and adding a tween manually.</p> </div> <p>Fill &#39;properties&#39; with key-value pairs that describe both the tween and the animation target. Here is an example:</p> <pre> juggler.tween(object, 2.0, { transition: Transitions.EASE_IN_OUT, delay: 20, // -> tween.delay = 20 x: 50 // -> tween.animate("x", 50) }); </pre> <p>To cancel the tween, call &#39;Juggler.removeTweens&#39; with the same target, or pass the returned &#39;IAnimatable&#39; instance to &#39;Juggler.remove()&#39;. Do not use the returned IAnimatable otherwise; it is taken from a pool and will be reused.</p> <p> <p>Note that some property types may be animated in a special way:</p> <ul> <li>If the property contains the string <code>color</code> or <code>Color</code>, it will be treated as an unsigned integer with a color value (e.g. <code>0xff0000</code> for red). Each color channel will be animated individually.</li> <li>The same happens if you append the string <code>#rgb</code> to the name.</li> <li>If you append <code>#rad</code>, the property is treated as an angle in radians, making sure it always uses the shortest possible arc for the rotation.</li> <li>The string <code>#deg</code> does the same for angles in degrees.</li> </ul></p> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>target: <span class="tsd-signature-type">any</span></h5> </li> <li> <h5>time: <span class="tsd-signature-type">number</span></h5> </li> <li> <h5>properties: <span class="tsd-signature-type">any</span></h5> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4> </li> </ul> </section> </section> </div> <div class="col-4 col-menu menu-sticky-wrap menu-highlight"> <nav class="tsd-navigation primary"> <ul> <li class="label tsd-is-external"> <span>Externals</span> </li> <li class="current tsd-kind-module tsd-parent-kind-module tsd-is-external"> <a href="../modules/starling.animation.html">starling.animation</a> </li> <li class=" tsd-kind-module tsd-parent-kind-module tsd-is-external"> <a href="../modules/starling.assets.html">starling.assets</a> </li> <li class=" tsd-kind-module tsd-parent-kind-module tsd-is-external"> <a href="../modules/starling.core.html">starling.core</a> </li> <li class=" tsd-kind-module tsd-parent-kind-module tsd-is-external"> <a href="../modules/starling.display.html">starling.display</a> </li> <li class=" tsd-kind-module tsd-parent-kind-module tsd-is-external"> <a href="../modules/starling.errors.html">starling.errors</a> </li> <li class=" tsd-kind-module tsd-parent-kind-module tsd-is-external"> <a href="../modules/starling.events.html">starling.events</a> </li> <li class=" tsd-kind-module tsd-parent-kind-module tsd-is-external"> <a href="../modules/starling.extensions.html">starling.extensions</a> </li> <li class=" tsd-kind-module tsd-parent-kind-module tsd-is-external"> <a href="../modules/starling.filters.html">starling.filters</a> </li> <li class=" tsd-kind-module tsd-parent-kind-module tsd-is-external"> <a href="../modules/starling.geom.html">starling.geom</a> </li> <li class=" tsd-kind-module tsd-parent-kind-module tsd-is-external"> <a href="../modules/starling.rendering.html">starling.rendering</a> </li> <li class=" tsd-kind-module tsd-parent-kind-module tsd-is-external"> <a href="../modules/starling.styles.html">starling.styles</a> </li> <li class=" tsd-kind-module tsd-parent-kind-module tsd-is-external"> <a href="../modules/starling.text.html">starling.text</a> </li> <li class=" tsd-kind-module tsd-parent-kind-module tsd-is-external"> <a href="../modules/starling.textures.html">starling.textures</a> </li> <li class=" tsd-kind-module tsd-parent-kind-module tsd-is-external"> <a href="../modules/starling.utils.html">starling.utils</a> </li> </ul> </nav> <nav class="tsd-navigation secondary menu-sticky"> <ul class="before-current"> <li class=" tsd-kind-class tsd-parent-kind-module tsd-is-external"> <a href="starling.animation.beziereasing.html" class="tsd-kind-icon">Bezier<wbr>Easing</a> </li> <li class=" tsd-kind-class tsd-parent-kind-module tsd-is-external"> <a href="starling.animation.delayedcall.html" class="tsd-kind-icon">Delayed<wbr>Call</a> </li> <li class=" tsd-kind-class tsd-parent-kind-module tsd-is-external"> <a href="starling.animation.ianimatable.html" class="tsd-kind-icon">IAnimatable</a> </li> </ul> <ul class="current"> <li class="current tsd-kind-class tsd-parent-kind-module tsd-is-external"> <a href="starling.animation.juggler.html" class="tsd-kind-icon">Juggler</a> <ul> <li class=" tsd-kind-constructor tsd-parent-kind-class tsd-is-external"> <a href="starling.animation.juggler.html#constructor" class="tsd-kind-icon">constructor</a> </li> <li class=" tsd-kind-property tsd-parent-kind-class tsd-is-external"> <a href="starling.animation.juggler.html#elapsedtime" class="tsd-kind-icon">elapsed<wbr>Time</a> </li> <li class=" tsd-kind-property tsd-parent-kind-class tsd-is-protected tsd-is-external"> <a href="starling.animation.juggler.html#objects" class="tsd-kind-icon">objects</a> </li> <li class=" tsd-kind-property tsd-parent-kind-class tsd-is-external"> <a href="starling.animation.juggler.html#timescale" class="tsd-kind-icon">time<wbr>Scale</a> </li> <li class=" tsd-kind-method tsd-parent-kind-class tsd-is-external"> <a href="starling.animation.juggler.html#add" class="tsd-kind-icon">add</a> </li> <li class=" tsd-kind-method tsd-parent-kind-class tsd-is-external"> <a href="starling.animation.juggler.html#addwithid" class="tsd-kind-icon">add<wbr>WithID</a> </li> <li class=" tsd-kind-method tsd-parent-kind-class tsd-is-external"> <a href="starling.animation.juggler.html#advancetime" class="tsd-kind-icon">advance<wbr>Time</a> </li> <li class=" tsd-kind-method tsd-parent-kind-class tsd-is-external"> <a href="starling.animation.juggler.html#contains" class="tsd-kind-icon">contains</a> </li> <li class=" tsd-kind-method tsd-parent-kind-class tsd-is-external"> <a href="starling.animation.juggler.html#containsdelayedcalls" class="tsd-kind-icon">contains<wbr>Delayed<wbr>Calls</a> </li> <li class=" tsd-kind-method tsd-parent-kind-class tsd-is-external"> <a href="starling.animation.juggler.html#containstweens" class="tsd-kind-icon">contains<wbr>Tweens</a> </li> <li class=" tsd-kind-method tsd-parent-kind-class tsd-is-external"> <a href="starling.animation.juggler.html#delaycall" class="tsd-kind-icon">delay<wbr>Call</a> </li> <li class=" tsd-kind-method tsd-parent-kind-class tsd-is-protected tsd-is-external"> <a href="starling.animation.juggler.html#get_elapsedtime" class="tsd-kind-icon">get_<wbr>elapsed<wbr>Time</a> </li> <li class=" tsd-kind-method tsd-parent-kind-class tsd-is-protected tsd-is-external"> <a href="starling.animation.juggler.html#get_objects" class="tsd-kind-icon">get_<wbr>objects</a> </li> <li class=" tsd-kind-method tsd-parent-kind-class tsd-is-protected tsd-is-external"> <a href="starling.animation.juggler.html#get_timescale" class="tsd-kind-icon">get_<wbr>time<wbr>Scale</a> </li> <li class=" tsd-kind-method tsd-parent-kind-class tsd-is-external"> <a href="starling.animation.juggler.html#purge" class="tsd-kind-icon">purge</a> </li> <li class=" tsd-kind-method tsd-parent-kind-class tsd-is-external"> <a href="starling.animation.juggler.html#remove" class="tsd-kind-icon">remove</a> </li> <li class=" tsd-kind-method tsd-parent-kind-class tsd-is-external"> <a href="starling.animation.juggler.html#removebyid" class="tsd-kind-icon">remove<wbr>By