swapChildren and getChildAt function added to DisplayObjectContainer
docs updated
This commit is contained in:
parent
760e0a5c56
commit
4dda5d1c18
22 changed files with 1940 additions and 43 deletions
|
@ -435,6 +435,64 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Swaps the depth of 2 displayObjects
|
||||
* @method swapChildren
|
||||
* @param DisplayObject {DisplayObject}
|
||||
* @param DisplayObject2 {DisplayObject}
|
||||
*/
|
||||
PIXI.DisplayObjectContainer.prototype.swapChildren = function(child, child2)
|
||||
{
|
||||
// TODO I already know this??
|
||||
var index = this.children.indexOf( child );
|
||||
var index2 = this.children.indexOf( child2 );
|
||||
|
||||
if ( index !== -1 && index2 !== -1 )
|
||||
{
|
||||
// cool
|
||||
if(this.stage)
|
||||
{
|
||||
// this is to satisfy the webGL batching..
|
||||
// TODO sure there is a nicer way to achieve this!
|
||||
this.stage.__removeChild(child);
|
||||
this.stage.__removeChild(child2);
|
||||
|
||||
this.stage.__addChild(child);
|
||||
this.stage.__addChild(child2);
|
||||
}
|
||||
|
||||
// swap the indexes..
|
||||
child.childIndex = index2;
|
||||
child2.childIndex = index;
|
||||
// swap the positions..
|
||||
this.children[index] = child2;
|
||||
this.children[index2] = child;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Error(child + " Both the supplied DisplayObjects must be a child of the caller " + this);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the Child at the specified index
|
||||
* @method getChildAt
|
||||
* @param index {Number}
|
||||
*/
|
||||
PIXI.DisplayObjectContainer.prototype.getChildAt = function(index)
|
||||
{
|
||||
if(index >= 0 && index < this.children.length)
|
||||
{
|
||||
return this.children[index];
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Error(child + " Both the supplied DisplayObjects must be a child of the caller " + this);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a child from the container.
|
||||
* @method removeChild
|
||||
|
@ -2033,8 +2091,7 @@ PIXI.WebGLRenderer.prototype.render = function(stage)
|
|||
{
|
||||
if(this.contextLost)return;
|
||||
|
||||
|
||||
|
||||
|
||||
// if rendering a new stage clear the batchs..
|
||||
if(this.__stage !== stage)
|
||||
{
|
||||
|
@ -2050,6 +2107,7 @@ PIXI.WebGLRenderer.prototype.render = function(stage)
|
|||
}
|
||||
|
||||
|
||||
|
||||
// update any textures
|
||||
for (var i=0; i < PIXI.texturesToUpdate.length; i++) this.updateTexture(PIXI.texturesToUpdate[i]);
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -249,6 +249,13 @@
|
|||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="index-item method">
|
||||
<a href="#method_getChildAt">getChildAt</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="index-item method inherited">
|
||||
|
@ -298,6 +305,13 @@
|
|||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="index-item method">
|
||||
<a href="#method_swapChildren">swapChildren</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="index-item method inherited">
|
||||
|
@ -691,6 +705,93 @@
|
|||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="method_getChildAt" class="method item">
|
||||
<h3 class="name"><code>getChildAt</code></h3>
|
||||
|
||||
|
||||
<div class="args">
|
||||
<span class="paren">(</span><ul class="args-list inline commas">
|
||||
|
||||
<li class="arg">
|
||||
|
||||
<code>index</code>
|
||||
|
||||
</li>
|
||||
|
||||
</ul><span class="paren">)</span>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="meta">
|
||||
|
||||
|
||||
|
||||
<p>
|
||||
|
||||
Defined in
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l137"><code>src/pixi/DisplayObjectContainer.js:137</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="description">
|
||||
<p>Returns the Child at the specified index</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="params">
|
||||
<h4>Parameters:</h4>
|
||||
|
||||
<ul class="params-list">
|
||||
|
||||
<li class="param">
|
||||
|
||||
<code class="param-name">index</code>
|
||||
<span class="type">Number</span>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="param-description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
@ -1158,7 +1259,7 @@ for this callback to be fired, The touch must have started over the displayObjec
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l97"><code>src/pixi/DisplayObjectContainer.js:97</code></a>
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l155"><code>src/pixi/DisplayObjectContainer.js:155</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1284,6 +1385,114 @@ for this callback to be fired, The touch must have started over the displayObjec
|
|||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="method_swapChildren" class="method item">
|
||||
<h3 class="name"><code>swapChildren</code></h3>
|
||||
|
||||
|
||||
<div class="args">
|
||||
<span class="paren">(</span><ul class="args-list inline commas">
|
||||
|
||||
<li class="arg">
|
||||
|
||||
<code>DisplayObject</code>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="arg">
|
||||
|
||||
<code>DisplayObject2</code>
|
||||
|
||||
</li>
|
||||
|
||||
</ul><span class="paren">)</span>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="meta">
|
||||
|
||||
|
||||
|
||||
<p>
|
||||
|
||||
Defined in
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l97"><code>src/pixi/DisplayObjectContainer.js:97</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="description">
|
||||
<p>Swaps the depth of 2 displayObjects</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="params">
|
||||
<h4>Parameters:</h4>
|
||||
|
||||
<ul class="params-list">
|
||||
|
||||
<li class="param">
|
||||
|
||||
<code class="param-name">DisplayObject</code>
|
||||
<span class="type"><a href="../classes/DisplayObject.html" class="crosslink">DisplayObject</a></span>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="param-description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="param">
|
||||
|
||||
<code class="param-name">DisplayObject2</code>
|
||||
<span class="type"><a href="../classes/DisplayObject.html" class="crosslink">DisplayObject</a></span>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="param-description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
|
|
@ -282,6 +282,13 @@
|
|||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="index-item method inherited">
|
||||
<a href="#method_getChildAt">getChildAt</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="index-item method">
|
||||
|
@ -366,6 +373,13 @@
|
|||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="index-item method inherited">
|
||||
<a href="#method_swapChildren">swapChildren</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="index-item method inherited">
|
||||
|
@ -460,6 +474,20 @@
|
|||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="index-item property">
|
||||
<a href="#property_loop">loop</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="index-item property">
|
||||
<a href="#property_onComplete">onComplete</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="index-item property inherited">
|
||||
|
@ -816,6 +844,90 @@
|
|||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="method_getChildAt" class="method item inherited">
|
||||
<h3 class="name"><code>getChildAt</code></h3>
|
||||
|
||||
|
||||
<div class="args">
|
||||
<span class="paren">(</span><ul class="args-list inline commas">
|
||||
|
||||
<li class="arg">
|
||||
|
||||
<code>index</code>
|
||||
|
||||
</li>
|
||||
|
||||
</ul><span class="paren">)</span>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="meta">
|
||||
|
||||
|
||||
<p>Inherited from
|
||||
<a href="../classes/DisplayObjectContainer.html#method_getChildAt">DisplayObjectContainer</a>:
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l137"><code>src/pixi/DisplayObjectContainer.js:137</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="description">
|
||||
<p>Returns the Child at the specified index</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="params">
|
||||
<h4>Parameters:</h4>
|
||||
|
||||
<ul class="params-list">
|
||||
|
||||
<li class="param">
|
||||
|
||||
<code class="param-name">index</code>
|
||||
<span class="type">Number</span>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="param-description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
@ -861,7 +973,7 @@
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_MovieClip.js.html#l80"><code>src/pixi/MovieClip.js:80</code></a>
|
||||
<a href="../files/src_pixi_MovieClip.js.html#l94"><code>src/pixi/MovieClip.js:94</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -948,7 +1060,7 @@
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_MovieClip.js.html#l67"><code>src/pixi/MovieClip.js:67</code></a>
|
||||
<a href="../files/src_pixi_MovieClip.js.html#l81"><code>src/pixi/MovieClip.js:81</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1447,7 +1559,7 @@ for this callback to be fired, The touch must have started over the displayObjec
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_MovieClip.js.html#l58"><code>src/pixi/MovieClip.js:58</code></a>
|
||||
<a href="../files/src_pixi_MovieClip.js.html#l72"><code>src/pixi/MovieClip.js:72</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1508,7 +1620,7 @@ for this callback to be fired, The touch must have started over the displayObjec
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l97"><code>src/pixi/DisplayObjectContainer.js:97</code></a>
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l155"><code>src/pixi/DisplayObjectContainer.js:155</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1753,7 +1865,7 @@ for this callback to be fired, The touch must have started over the displayObjec
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_MovieClip.js.html#l49"><code>src/pixi/MovieClip.js:49</code></a>
|
||||
<a href="../files/src_pixi_MovieClip.js.html#l63"><code>src/pixi/MovieClip.js:63</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1772,6 +1884,111 @@ for this callback to be fired, The touch must have started over the displayObjec
|
|||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="method_swapChildren" class="method item inherited">
|
||||
<h3 class="name"><code>swapChildren</code></h3>
|
||||
|
||||
|
||||
<div class="args">
|
||||
<span class="paren">(</span><ul class="args-list inline commas">
|
||||
|
||||
<li class="arg">
|
||||
|
||||
<code>DisplayObject</code>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="arg">
|
||||
|
||||
<code>DisplayObject2</code>
|
||||
|
||||
</li>
|
||||
|
||||
</ul><span class="paren">)</span>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="meta">
|
||||
|
||||
|
||||
<p>Inherited from
|
||||
<a href="../classes/DisplayObjectContainer.html#method_swapChildren">DisplayObjectContainer</a>:
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l97"><code>src/pixi/DisplayObjectContainer.js:97</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="description">
|
||||
<p>Swaps the depth of 2 displayObjects</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="params">
|
||||
<h4>Parameters:</h4>
|
||||
|
||||
<ul class="params-list">
|
||||
|
||||
<li class="param">
|
||||
|
||||
<code class="param-name">DisplayObject</code>
|
||||
<span class="type"><a href="../classes/DisplayObject.html" class="crosslink">DisplayObject</a></span>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="param-description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="param">
|
||||
|
||||
<code class="param-name">DisplayObject2</code>
|
||||
<span class="type"><a href="../classes/DisplayObject.html" class="crosslink">DisplayObject</a></span>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="param-description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
@ -2457,6 +2674,94 @@ Setting it is a neat way of optimising the hitTest function that the interaction
|
|||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="property_loop" class="property item">
|
||||
<h3 class="name"><code>loop</code></h3>
|
||||
<span class="type">Boolean</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="meta">
|
||||
|
||||
|
||||
|
||||
<p>
|
||||
|
||||
Defined in
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_MovieClip.js.html#l37"><code>src/pixi/MovieClip.js:37</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="description">
|
||||
<p>Whether or not the movie clip repeats after playing.</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="property_onComplete" class="property item">
|
||||
<h3 class="name"><code>onComplete</code></h3>
|
||||
<span class="type">Function</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="meta">
|
||||
|
||||
|
||||
|
||||
<p>
|
||||
|
||||
Defined in
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_MovieClip.js.html#l44"><code>src/pixi/MovieClip.js:44</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="description">
|
||||
<p>Function to call when a MovieClip finishes playing</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
@ -2524,7 +2829,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_MovieClip.js.html#l37"><code>src/pixi/MovieClip.js:37</code></a>
|
||||
<a href="../files/src_pixi_MovieClip.js.html#l51"><code>src/pixi/MovieClip.js:51</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
|
|
@ -300,6 +300,13 @@
|
|||
<span class="flag static">static</span>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="index-item method inherited">
|
||||
<a href="#method_getChildAt">getChildAt</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="index-item method inherited">
|
||||
|
@ -356,6 +363,13 @@
|
|||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="index-item method inherited">
|
||||
<a href="#method_swapChildren">swapChildren</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="index-item method inherited">
|
||||
|
@ -992,6 +1006,90 @@
|
|||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="method_getChildAt" class="method item inherited">
|
||||
<h3 class="name"><code>getChildAt</code></h3>
|
||||
|
||||
|
||||
<div class="args">
|
||||
<span class="paren">(</span><ul class="args-list inline commas">
|
||||
|
||||
<li class="arg">
|
||||
|
||||
<code>index</code>
|
||||
|
||||
</li>
|
||||
|
||||
</ul><span class="paren">)</span>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="meta">
|
||||
|
||||
|
||||
<p>Inherited from
|
||||
<a href="../classes/DisplayObjectContainer.html#method_getChildAt">DisplayObjectContainer</a>:
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l137"><code>src/pixi/DisplayObjectContainer.js:137</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="description">
|
||||
<p>Returns the Child at the specified index</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="params">
|
||||
<h4>Parameters:</h4>
|
||||
|
||||
<ul class="params-list">
|
||||
|
||||
<li class="param">
|
||||
|
||||
<code class="param-name">index</code>
|
||||
<span class="type">Number</span>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="param-description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
@ -1456,7 +1554,7 @@ for this callback to be fired, The touch must have started over the displayObjec
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l97"><code>src/pixi/DisplayObjectContainer.js:97</code></a>
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l155"><code>src/pixi/DisplayObjectContainer.js:155</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1669,6 +1767,111 @@ for this callback to be fired, The touch must have started over the displayObjec
|
|||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="method_swapChildren" class="method item inherited">
|
||||
<h3 class="name"><code>swapChildren</code></h3>
|
||||
|
||||
|
||||
<div class="args">
|
||||
<span class="paren">(</span><ul class="args-list inline commas">
|
||||
|
||||
<li class="arg">
|
||||
|
||||
<code>DisplayObject</code>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="arg">
|
||||
|
||||
<code>DisplayObject2</code>
|
||||
|
||||
</li>
|
||||
|
||||
</ul><span class="paren">)</span>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="meta">
|
||||
|
||||
|
||||
<p>Inherited from
|
||||
<a href="../classes/DisplayObjectContainer.html#method_swapChildren">DisplayObjectContainer</a>:
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l97"><code>src/pixi/DisplayObjectContainer.js:97</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="description">
|
||||
<p>Swaps the depth of 2 displayObjects</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="params">
|
||||
<h4>Parameters:</h4>
|
||||
|
||||
<ul class="params-list">
|
||||
|
||||
<li class="param">
|
||||
|
||||
<code class="param-name">DisplayObject</code>
|
||||
<span class="type"><a href="../classes/DisplayObject.html" class="crosslink">DisplayObject</a></span>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="param-description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="param">
|
||||
|
||||
<code class="param-name">DisplayObject2</code>
|
||||
<span class="type"><a href="../classes/DisplayObject.html" class="crosslink">DisplayObject</a></span>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="param-description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
|
|
@ -303,6 +303,13 @@
|
|||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="index-item method inherited">
|
||||
<a href="#method_getChildAt">getChildAt</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="index-item method inherited">
|
||||
|
@ -359,6 +366,13 @@
|
|||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="index-item method inherited">
|
||||
<a href="#method_swapChildren">swapChildren</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="index-item method inherited">
|
||||
|
@ -753,6 +767,90 @@
|
|||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="method_getChildAt" class="method item inherited">
|
||||
<h3 class="name"><code>getChildAt</code></h3>
|
||||
|
||||
|
||||
<div class="args">
|
||||
<span class="paren">(</span><ul class="args-list inline commas">
|
||||
|
||||
<li class="arg">
|
||||
|
||||
<code>index</code>
|
||||
|
||||
</li>
|
||||
|
||||
</ul><span class="paren">)</span>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="meta">
|
||||
|
||||
|
||||
<p>Inherited from
|
||||
<a href="../classes/DisplayObjectContainer.html#method_getChildAt">DisplayObjectContainer</a>:
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l137"><code>src/pixi/DisplayObjectContainer.js:137</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="description">
|
||||
<p>Returns the Child at the specified index</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="params">
|
||||
<h4>Parameters:</h4>
|
||||
|
||||
<ul class="params-list">
|
||||
|
||||
<li class="param">
|
||||
|
||||
<code class="param-name">index</code>
|
||||
<span class="type">Number</span>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="param-description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
@ -1217,7 +1315,7 @@ for this callback to be fired, The touch must have started over the displayObjec
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l97"><code>src/pixi/DisplayObjectContainer.js:97</code></a>
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l155"><code>src/pixi/DisplayObjectContainer.js:155</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1430,6 +1528,111 @@ for this callback to be fired, The touch must have started over the displayObjec
|
|||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="method_swapChildren" class="method item inherited">
|
||||
<h3 class="name"><code>swapChildren</code></h3>
|
||||
|
||||
|
||||
<div class="args">
|
||||
<span class="paren">(</span><ul class="args-list inline commas">
|
||||
|
||||
<li class="arg">
|
||||
|
||||
<code>DisplayObject</code>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="arg">
|
||||
|
||||
<code>DisplayObject2</code>
|
||||
|
||||
</li>
|
||||
|
||||
</ul><span class="paren">)</span>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="meta">
|
||||
|
||||
|
||||
<p>Inherited from
|
||||
<a href="../classes/DisplayObjectContainer.html#method_swapChildren">DisplayObjectContainer</a>:
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l97"><code>src/pixi/DisplayObjectContainer.js:97</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="description">
|
||||
<p>Swaps the depth of 2 displayObjects</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="params">
|
||||
<h4>Parameters:</h4>
|
||||
|
||||
<ul class="params-list">
|
||||
|
||||
<li class="param">
|
||||
|
||||
<code class="param-name">DisplayObject</code>
|
||||
<span class="type"><a href="../classes/DisplayObject.html" class="crosslink">DisplayObject</a></span>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="param-description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="param">
|
||||
|
||||
<code class="param-name">DisplayObject2</code>
|
||||
<span class="type"><a href="../classes/DisplayObject.html" class="crosslink">DisplayObject</a></span>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="param-description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
|
|
@ -324,6 +324,13 @@
|
|||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="index-item method inherited">
|
||||
<a href="#method_getChildAt">getChildAt</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="index-item method inherited">
|
||||
|
@ -373,6 +380,13 @@
|
|||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="index-item method inherited">
|
||||
<a href="#method_swapChildren">swapChildren</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="index-item method inherited">
|
||||
|
@ -774,6 +788,90 @@
|
|||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="method_getChildAt" class="method item inherited">
|
||||
<h3 class="name"><code>getChildAt</code></h3>
|
||||
|
||||
|
||||
<div class="args">
|
||||
<span class="paren">(</span><ul class="args-list inline commas">
|
||||
|
||||
<li class="arg">
|
||||
|
||||
<code>index</code>
|
||||
|
||||
</li>
|
||||
|
||||
</ul><span class="paren">)</span>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="meta">
|
||||
|
||||
|
||||
<p>Inherited from
|
||||
<a href="../classes/DisplayObjectContainer.html#method_getChildAt">DisplayObjectContainer</a>:
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l137"><code>src/pixi/DisplayObjectContainer.js:137</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="description">
|
||||
<p>Returns the Child at the specified index</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="params">
|
||||
<h4>Parameters:</h4>
|
||||
|
||||
<ul class="params-list">
|
||||
|
||||
<li class="param">
|
||||
|
||||
<code class="param-name">index</code>
|
||||
<span class="type">Number</span>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="param-description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
@ -1238,7 +1336,7 @@ for this callback to be fired, The touch must have started over the displayObjec
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l97"><code>src/pixi/DisplayObjectContainer.js:97</code></a>
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l155"><code>src/pixi/DisplayObjectContainer.js:155</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1364,6 +1462,111 @@ for this callback to be fired, The touch must have started over the displayObjec
|
|||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="method_swapChildren" class="method item inherited">
|
||||
<h3 class="name"><code>swapChildren</code></h3>
|
||||
|
||||
|
||||
<div class="args">
|
||||
<span class="paren">(</span><ul class="args-list inline commas">
|
||||
|
||||
<li class="arg">
|
||||
|
||||
<code>DisplayObject</code>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="arg">
|
||||
|
||||
<code>DisplayObject2</code>
|
||||
|
||||
</li>
|
||||
|
||||
</ul><span class="paren">)</span>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="meta">
|
||||
|
||||
|
||||
<p>Inherited from
|
||||
<a href="../classes/DisplayObjectContainer.html#method_swapChildren">DisplayObjectContainer</a>:
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l97"><code>src/pixi/DisplayObjectContainer.js:97</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="description">
|
||||
<p>Swaps the depth of 2 displayObjects</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="params">
|
||||
<h4>Parameters:</h4>
|
||||
|
||||
<ul class="params-list">
|
||||
|
||||
<li class="param">
|
||||
|
||||
<code class="param-name">DisplayObject</code>
|
||||
<span class="type"><a href="../classes/DisplayObject.html" class="crosslink">DisplayObject</a></span>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="param-description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="param">
|
||||
|
||||
<code class="param-name">DisplayObject2</code>
|
||||
<span class="type"><a href="../classes/DisplayObject.html" class="crosslink">DisplayObject</a></span>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="param-description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
|
|
@ -1666,6 +1666,41 @@
|
|||
{
|
||||
"file": "src/pixi/DisplayObjectContainer.js",
|
||||
"line": 97,
|
||||
"description": "Swaps the depth of 2 displayObjects",
|
||||
"itemtype": "method",
|
||||
"name": "swapChildren",
|
||||
"params": [
|
||||
{
|
||||
"name": "DisplayObject",
|
||||
"description": "",
|
||||
"type": "DisplayObject"
|
||||
},
|
||||
{
|
||||
"name": "DisplayObject2",
|
||||
"description": "",
|
||||
"type": "DisplayObject"
|
||||
}
|
||||
],
|
||||
"class": "DisplayObjectContainer"
|
||||
},
|
||||
{
|
||||
"file": "src/pixi/DisplayObjectContainer.js",
|
||||
"line": 137,
|
||||
"description": "Returns the Child at the specified index",
|
||||
"itemtype": "method",
|
||||
"name": "getChildAt",
|
||||
"params": [
|
||||
{
|
||||
"name": "index",
|
||||
"description": "",
|
||||
"type": "Number"
|
||||
}
|
||||
],
|
||||
"class": "DisplayObjectContainer"
|
||||
},
|
||||
{
|
||||
"file": "src/pixi/DisplayObjectContainer.js",
|
||||
"line": 155,
|
||||
"description": "Removes a child from the container.",
|
||||
"itemtype": "method",
|
||||
"name": "removeChild",
|
||||
|
@ -1680,7 +1715,7 @@
|
|||
},
|
||||
{
|
||||
"file": "src/pixi/DisplayObjectContainer.js",
|
||||
"line": 126,
|
||||
"line": 184,
|
||||
"access": "private",
|
||||
"tagname": "",
|
||||
"class": "DisplayObjectContainer"
|
||||
|
@ -1791,6 +1826,24 @@
|
|||
{
|
||||
"file": "src/pixi/MovieClip.js",
|
||||
"line": 37,
|
||||
"description": "Whether or not the movie clip repeats after playing.",
|
||||
"itemtype": "property",
|
||||
"name": "loop",
|
||||
"type": "Boolean",
|
||||
"class": "MovieClip"
|
||||
},
|
||||
{
|
||||
"file": "src/pixi/MovieClip.js",
|
||||
"line": 44,
|
||||
"description": "Function to call when a MovieClip finishes playing",
|
||||
"itemtype": "property",
|
||||
"name": "onComplete",
|
||||
"type": "Function",
|
||||
"class": "MovieClip"
|
||||
},
|
||||
{
|
||||
"file": "src/pixi/MovieClip.js",
|
||||
"line": 51,
|
||||
"description": "[read only] indicates if the MovieClip is currently playing",
|
||||
"itemtype": "property",
|
||||
"name": "playing",
|
||||
|
@ -1799,7 +1852,7 @@
|
|||
},
|
||||
{
|
||||
"file": "src/pixi/MovieClip.js",
|
||||
"line": 49,
|
||||
"line": 63,
|
||||
"description": "Stops the MovieClip",
|
||||
"itemtype": "method",
|
||||
"name": "stop",
|
||||
|
@ -1807,7 +1860,7 @@
|
|||
},
|
||||
{
|
||||
"file": "src/pixi/MovieClip.js",
|
||||
"line": 58,
|
||||
"line": 72,
|
||||
"description": "Plays the MovieClip",
|
||||
"itemtype": "method",
|
||||
"name": "play",
|
||||
|
@ -1815,7 +1868,7 @@
|
|||
},
|
||||
{
|
||||
"file": "src/pixi/MovieClip.js",
|
||||
"line": 67,
|
||||
"line": 81,
|
||||
"description": "Stops the MovieClip and goes to a specific frame",
|
||||
"itemtype": "method",
|
||||
"name": "gotoAndStop",
|
||||
|
@ -1830,7 +1883,7 @@
|
|||
},
|
||||
{
|
||||
"file": "src/pixi/MovieClip.js",
|
||||
"line": 80,
|
||||
"line": 94,
|
||||
"description": "Goes to a specific frame and begins playing the MovieClip",
|
||||
"itemtype": "method",
|
||||
"name": "gotoAndPlay",
|
||||
|
@ -2273,7 +2326,7 @@
|
|||
},
|
||||
{
|
||||
"message": "Missing item type",
|
||||
"line": " src/pixi/DisplayObjectContainer.js:126"
|
||||
"line": " src/pixi/DisplayObjectContainer.js:184"
|
||||
},
|
||||
{
|
||||
"message": "Missing item type",
|
||||
|
|
|
@ -216,6 +216,64 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Swaps the depth of 2 displayObjects
|
||||
* @method swapChildren
|
||||
* @param DisplayObject {DisplayObject}
|
||||
* @param DisplayObject2 {DisplayObject}
|
||||
*/
|
||||
PIXI.DisplayObjectContainer.prototype.swapChildren = function(child, child2)
|
||||
{
|
||||
// TODO I already know this??
|
||||
var index = this.children.indexOf( child );
|
||||
var index2 = this.children.indexOf( child2 );
|
||||
|
||||
if ( index !== -1 && index2 !== -1 )
|
||||
{
|
||||
// cool
|
||||
if(this.stage)
|
||||
{
|
||||
// this is to satisfy the webGL batching..
|
||||
// TODO sure there is a nicer way to achieve this!
|
||||
this.stage.__removeChild(child);
|
||||
this.stage.__removeChild(child2);
|
||||
|
||||
this.stage.__addChild(child);
|
||||
this.stage.__addChild(child2);
|
||||
}
|
||||
|
||||
// swap the indexes..
|
||||
child.childIndex = index2;
|
||||
child2.childIndex = index;
|
||||
// swap the positions..
|
||||
this.children[index] = child2;
|
||||
this.children[index2] = child;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Error(child + " Both the supplied DisplayObjects must be a child of the caller " + this);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the Child at the specified index
|
||||
* @method getChildAt
|
||||
* @param index {Number}
|
||||
*/
|
||||
PIXI.DisplayObjectContainer.prototype.getChildAt = function(index)
|
||||
{
|
||||
if(index >= 0 && index < this.children.length)
|
||||
{
|
||||
return this.children[index];
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Error(child + " Both the supplied DisplayObjects must be a child of the caller " + this);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a child from the container.
|
||||
* @method removeChild
|
||||
|
|
|
@ -155,6 +155,20 @@ PIXI.MovieClip = function(textures)
|
|||
* @type Number
|
||||
*/
|
||||
this.animationSpeed = 1;
|
||||
|
||||
/**
|
||||
* Whether or not the movie clip repeats after playing.
|
||||
* @property loop
|
||||
* @type Boolean
|
||||
*/
|
||||
this.loop = true;
|
||||
|
||||
/**
|
||||
* Function to call when a MovieClip finishes playing
|
||||
* @property onComplete
|
||||
* @type Function
|
||||
*/
|
||||
this.onComplete = null;
|
||||
|
||||
/**
|
||||
* [read only] indicates if the MovieClip is currently playing
|
||||
|
@ -218,7 +232,18 @@ PIXI.MovieClip.prototype.updateTransform = function()
|
|||
|
||||
this.currentFrame += this.animationSpeed;
|
||||
var round = (this.currentFrame + 0.5) | 0;
|
||||
this.setTexture(this.textures[round % this.textures.length]);
|
||||
if(this.loop || round < this.textures.length)
|
||||
{
|
||||
this.setTexture(this.textures[round % this.textures.length]);
|
||||
}
|
||||
else if(round >= this.textures.length)
|
||||
{
|
||||
this.gotoAndStop(this.textures.length - 1);
|
||||
if(this.onComplete)
|
||||
{
|
||||
this.onComplete();
|
||||
}
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
</div>
|
||||
|
|
|
@ -288,8 +288,7 @@ PIXI.WebGLRenderer.prototype.render = function(stage)
|
|||
{
|
||||
if(this.contextLost)return;
|
||||
|
||||
|
||||
|
||||
|
||||
// if rendering a new stage clear the batchs..
|
||||
if(this.__stage !== stage)
|
||||
{
|
||||
|
@ -305,6 +304,7 @@ PIXI.WebGLRenderer.prototype.render = function(stage)
|
|||
}
|
||||
|
||||
|
||||
|
||||
// update any textures
|
||||
for (var i=0; i < PIXI.texturesToUpdate.length; i++) this.updateTexture(PIXI.texturesToUpdate[i]);
|
||||
|
||||
|
|
|
@ -435,6 +435,64 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Swaps the depth of 2 displayObjects
|
||||
* @method swapChildren
|
||||
* @param DisplayObject {DisplayObject}
|
||||
* @param DisplayObject2 {DisplayObject}
|
||||
*/
|
||||
PIXI.DisplayObjectContainer.prototype.swapChildren = function(child, child2)
|
||||
{
|
||||
// TODO I already know this??
|
||||
var index = this.children.indexOf( child );
|
||||
var index2 = this.children.indexOf( child2 );
|
||||
|
||||
if ( index !== -1 && index2 !== -1 )
|
||||
{
|
||||
// cool
|
||||
if(this.stage)
|
||||
{
|
||||
// this is to satisfy the webGL batching..
|
||||
// TODO sure there is a nicer way to achieve this!
|
||||
this.stage.__removeChild(child);
|
||||
this.stage.__removeChild(child2);
|
||||
|
||||
this.stage.__addChild(child);
|
||||
this.stage.__addChild(child2);
|
||||
}
|
||||
|
||||
// swap the indexes..
|
||||
child.childIndex = index2;
|
||||
child2.childIndex = index;
|
||||
// swap the positions..
|
||||
this.children[index] = child2;
|
||||
this.children[index2] = child;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Error(child + " Both the supplied DisplayObjects must be a child of the caller " + this);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the Child at the specified index
|
||||
* @method getChildAt
|
||||
* @param index {Number}
|
||||
*/
|
||||
PIXI.DisplayObjectContainer.prototype.getChildAt = function(index)
|
||||
{
|
||||
if(index >= 0 && index < this.children.length)
|
||||
{
|
||||
return this.children[index];
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Error(child + " Both the supplied DisplayObjects must be a child of the caller " + this);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a child from the container.
|
||||
* @method removeChild
|
||||
|
@ -2033,8 +2091,7 @@ PIXI.WebGLRenderer.prototype.render = function(stage)
|
|||
{
|
||||
if(this.contextLost)return;
|
||||
|
||||
|
||||
|
||||
|
||||
// if rendering a new stage clear the batchs..
|
||||
if(this.__stage !== stage)
|
||||
{
|
||||
|
@ -2050,6 +2107,7 @@ PIXI.WebGLRenderer.prototype.render = function(stage)
|
|||
}
|
||||
|
||||
|
||||
|
||||
// update any textures
|
||||
for (var i=0; i < PIXI.texturesToUpdate.length; i++) this.updateTexture(PIXI.texturesToUpdate[i]);
|
||||
|
||||
|
|
|
@ -435,6 +435,64 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Swaps the depth of 2 displayObjects
|
||||
* @method swapChildren
|
||||
* @param DisplayObject {DisplayObject}
|
||||
* @param DisplayObject2 {DisplayObject}
|
||||
*/
|
||||
PIXI.DisplayObjectContainer.prototype.swapChildren = function(child, child2)
|
||||
{
|
||||
// TODO I already know this??
|
||||
var index = this.children.indexOf( child );
|
||||
var index2 = this.children.indexOf( child2 );
|
||||
|
||||
if ( index !== -1 && index2 !== -1 )
|
||||
{
|
||||
// cool
|
||||
if(this.stage)
|
||||
{
|
||||
// this is to satisfy the webGL batching..
|
||||
// TODO sure there is a nicer way to achieve this!
|
||||
this.stage.__removeChild(child);
|
||||
this.stage.__removeChild(child2);
|
||||
|
||||
this.stage.__addChild(child);
|
||||
this.stage.__addChild(child2);
|
||||
}
|
||||
|
||||
// swap the indexes..
|
||||
child.childIndex = index2;
|
||||
child2.childIndex = index;
|
||||
// swap the positions..
|
||||
this.children[index] = child2;
|
||||
this.children[index2] = child;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Error(child + " Both the supplied DisplayObjects must be a child of the caller " + this);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the Child at the specified index
|
||||
* @method getChildAt
|
||||
* @param index {Number}
|
||||
*/
|
||||
PIXI.DisplayObjectContainer.prototype.getChildAt = function(index)
|
||||
{
|
||||
if(index >= 0 && index < this.children.length)
|
||||
{
|
||||
return this.children[index];
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Error(child + " Both the supplied DisplayObjects must be a child of the caller " + this);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a child from the container.
|
||||
* @method removeChild
|
||||
|
@ -2033,8 +2091,7 @@ PIXI.WebGLRenderer.prototype.render = function(stage)
|
|||
{
|
||||
if(this.contextLost)return;
|
||||
|
||||
|
||||
|
||||
|
||||
// if rendering a new stage clear the batchs..
|
||||
if(this.__stage !== stage)
|
||||
{
|
||||
|
@ -2050,6 +2107,7 @@ PIXI.WebGLRenderer.prototype.render = function(stage)
|
|||
}
|
||||
|
||||
|
||||
|
||||
// update any textures
|
||||
for (var i=0; i < PIXI.texturesToUpdate.length; i++) this.updateTexture(PIXI.texturesToUpdate[i]);
|
||||
|
||||
|
|
|
@ -435,6 +435,64 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Swaps the depth of 2 displayObjects
|
||||
* @method swapChildren
|
||||
* @param DisplayObject {DisplayObject}
|
||||
* @param DisplayObject2 {DisplayObject}
|
||||
*/
|
||||
PIXI.DisplayObjectContainer.prototype.swapChildren = function(child, child2)
|
||||
{
|
||||
// TODO I already know this??
|
||||
var index = this.children.indexOf( child );
|
||||
var index2 = this.children.indexOf( child2 );
|
||||
|
||||
if ( index !== -1 && index2 !== -1 )
|
||||
{
|
||||
// cool
|
||||
if(this.stage)
|
||||
{
|
||||
// this is to satisfy the webGL batching..
|
||||
// TODO sure there is a nicer way to achieve this!
|
||||
this.stage.__removeChild(child);
|
||||
this.stage.__removeChild(child2);
|
||||
|
||||
this.stage.__addChild(child);
|
||||
this.stage.__addChild(child2);
|
||||
}
|
||||
|
||||
// swap the indexes..
|
||||
child.childIndex = index2;
|
||||
child2.childIndex = index;
|
||||
// swap the positions..
|
||||
this.children[index] = child2;
|
||||
this.children[index2] = child;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Error(child + " Both the supplied DisplayObjects must be a child of the caller " + this);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the Child at the specified index
|
||||
* @method getChildAt
|
||||
* @param index {Number}
|
||||
*/
|
||||
PIXI.DisplayObjectContainer.prototype.getChildAt = function(index)
|
||||
{
|
||||
if(index >= 0 && index < this.children.length)
|
||||
{
|
||||
return this.children[index];
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Error(child + " Both the supplied DisplayObjects must be a child of the caller " + this);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a child from the container.
|
||||
* @method removeChild
|
||||
|
@ -2033,8 +2091,7 @@ PIXI.WebGLRenderer.prototype.render = function(stage)
|
|||
{
|
||||
if(this.contextLost)return;
|
||||
|
||||
|
||||
|
||||
|
||||
// if rendering a new stage clear the batchs..
|
||||
if(this.__stage !== stage)
|
||||
{
|
||||
|
@ -2050,6 +2107,7 @@ PIXI.WebGLRenderer.prototype.render = function(stage)
|
|||
}
|
||||
|
||||
|
||||
|
||||
// update any textures
|
||||
for (var i=0; i < PIXI.texturesToUpdate.length; i++) this.updateTexture(PIXI.texturesToUpdate[i]);
|
||||
|
||||
|
|
|
@ -435,6 +435,64 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Swaps the depth of 2 displayObjects
|
||||
* @method swapChildren
|
||||
* @param DisplayObject {DisplayObject}
|
||||
* @param DisplayObject2 {DisplayObject}
|
||||
*/
|
||||
PIXI.DisplayObjectContainer.prototype.swapChildren = function(child, child2)
|
||||
{
|
||||
// TODO I already know this??
|
||||
var index = this.children.indexOf( child );
|
||||
var index2 = this.children.indexOf( child2 );
|
||||
|
||||
if ( index !== -1 && index2 !== -1 )
|
||||
{
|
||||
// cool
|
||||
if(this.stage)
|
||||
{
|
||||
// this is to satisfy the webGL batching..
|
||||
// TODO sure there is a nicer way to achieve this!
|
||||
this.stage.__removeChild(child);
|
||||
this.stage.__removeChild(child2);
|
||||
|
||||
this.stage.__addChild(child);
|
||||
this.stage.__addChild(child2);
|
||||
}
|
||||
|
||||
// swap the indexes..
|
||||
child.childIndex = index2;
|
||||
child2.childIndex = index;
|
||||
// swap the positions..
|
||||
this.children[index] = child2;
|
||||
this.children[index2] = child;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Error(child + " Both the supplied DisplayObjects must be a child of the caller " + this);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the Child at the specified index
|
||||
* @method getChildAt
|
||||
* @param index {Number}
|
||||
*/
|
||||
PIXI.DisplayObjectContainer.prototype.getChildAt = function(index)
|
||||
{
|
||||
if(index >= 0 && index < this.children.length)
|
||||
{
|
||||
return this.children[index];
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Error(child + " Both the supplied DisplayObjects must be a child of the caller " + this);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a child from the container.
|
||||
* @method removeChild
|
||||
|
@ -2033,8 +2091,7 @@ PIXI.WebGLRenderer.prototype.render = function(stage)
|
|||
{
|
||||
if(this.contextLost)return;
|
||||
|
||||
|
||||
|
||||
|
||||
// if rendering a new stage clear the batchs..
|
||||
if(this.__stage !== stage)
|
||||
{
|
||||
|
@ -2050,6 +2107,7 @@ PIXI.WebGLRenderer.prototype.render = function(stage)
|
|||
}
|
||||
|
||||
|
||||
|
||||
// update any textures
|
||||
for (var i=0; i < PIXI.texturesToUpdate.length; i++) this.updateTexture(PIXI.texturesToUpdate[i]);
|
||||
|
||||
|
|
|
@ -435,6 +435,64 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Swaps the depth of 2 displayObjects
|
||||
* @method swapChildren
|
||||
* @param DisplayObject {DisplayObject}
|
||||
* @param DisplayObject2 {DisplayObject}
|
||||
*/
|
||||
PIXI.DisplayObjectContainer.prototype.swapChildren = function(child, child2)
|
||||
{
|
||||
// TODO I already know this??
|
||||
var index = this.children.indexOf( child );
|
||||
var index2 = this.children.indexOf( child2 );
|
||||
|
||||
if ( index !== -1 && index2 !== -1 )
|
||||
{
|
||||
// cool
|
||||
if(this.stage)
|
||||
{
|
||||
// this is to satisfy the webGL batching..
|
||||
// TODO sure there is a nicer way to achieve this!
|
||||
this.stage.__removeChild(child);
|
||||
this.stage.__removeChild(child2);
|
||||
|
||||
this.stage.__addChild(child);
|
||||
this.stage.__addChild(child2);
|
||||
}
|
||||
|
||||
// swap the indexes..
|
||||
child.childIndex = index2;
|
||||
child2.childIndex = index;
|
||||
// swap the positions..
|
||||
this.children[index] = child2;
|
||||
this.children[index2] = child;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Error(child + " Both the supplied DisplayObjects must be a child of the caller " + this);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the Child at the specified index
|
||||
* @method getChildAt
|
||||
* @param index {Number}
|
||||
*/
|
||||
PIXI.DisplayObjectContainer.prototype.getChildAt = function(index)
|
||||
{
|
||||
if(index >= 0 && index < this.children.length)
|
||||
{
|
||||
return this.children[index];
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Error(child + " Both the supplied DisplayObjects must be a child of the caller " + this);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a child from the container.
|
||||
* @method removeChild
|
||||
|
@ -2033,8 +2091,7 @@ PIXI.WebGLRenderer.prototype.render = function(stage)
|
|||
{
|
||||
if(this.contextLost)return;
|
||||
|
||||
|
||||
|
||||
|
||||
// if rendering a new stage clear the batchs..
|
||||
if(this.__stage !== stage)
|
||||
{
|
||||
|
@ -2050,6 +2107,7 @@ PIXI.WebGLRenderer.prototype.render = function(stage)
|
|||
}
|
||||
|
||||
|
||||
|
||||
// update any textures
|
||||
for (var i=0; i < PIXI.texturesToUpdate.length; i++) this.updateTexture(PIXI.texturesToUpdate[i]);
|
||||
|
||||
|
|
|
@ -435,6 +435,64 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Swaps the depth of 2 displayObjects
|
||||
* @method swapChildren
|
||||
* @param DisplayObject {DisplayObject}
|
||||
* @param DisplayObject2 {DisplayObject}
|
||||
*/
|
||||
PIXI.DisplayObjectContainer.prototype.swapChildren = function(child, child2)
|
||||
{
|
||||
// TODO I already know this??
|
||||
var index = this.children.indexOf( child );
|
||||
var index2 = this.children.indexOf( child2 );
|
||||
|
||||
if ( index !== -1 && index2 !== -1 )
|
||||
{
|
||||
// cool
|
||||
if(this.stage)
|
||||
{
|
||||
// this is to satisfy the webGL batching..
|
||||
// TODO sure there is a nicer way to achieve this!
|
||||
this.stage.__removeChild(child);
|
||||
this.stage.__removeChild(child2);
|
||||
|
||||
this.stage.__addChild(child);
|
||||
this.stage.__addChild(child2);
|
||||
}
|
||||
|
||||
// swap the indexes..
|
||||
child.childIndex = index2;
|
||||
child2.childIndex = index;
|
||||
// swap the positions..
|
||||
this.children[index] = child2;
|
||||
this.children[index2] = child;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Error(child + " Both the supplied DisplayObjects must be a child of the caller " + this);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the Child at the specified index
|
||||
* @method getChildAt
|
||||
* @param index {Number}
|
||||
*/
|
||||
PIXI.DisplayObjectContainer.prototype.getChildAt = function(index)
|
||||
{
|
||||
if(index >= 0 && index < this.children.length)
|
||||
{
|
||||
return this.children[index];
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Error(child + " Both the supplied DisplayObjects must be a child of the caller " + this);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a child from the container.
|
||||
* @method removeChild
|
||||
|
@ -2033,8 +2091,7 @@ PIXI.WebGLRenderer.prototype.render = function(stage)
|
|||
{
|
||||
if(this.contextLost)return;
|
||||
|
||||
|
||||
|
||||
|
||||
// if rendering a new stage clear the batchs..
|
||||
if(this.__stage !== stage)
|
||||
{
|
||||
|
@ -2050,6 +2107,7 @@ PIXI.WebGLRenderer.prototype.render = function(stage)
|
|||
}
|
||||
|
||||
|
||||
|
||||
// update any textures
|
||||
for (var i=0; i < PIXI.texturesToUpdate.length; i++) this.updateTexture(PIXI.texturesToUpdate[i]);
|
||||
|
||||
|
|
|
@ -435,6 +435,64 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Swaps the depth of 2 displayObjects
|
||||
* @method swapChildren
|
||||
* @param DisplayObject {DisplayObject}
|
||||
* @param DisplayObject2 {DisplayObject}
|
||||
*/
|
||||
PIXI.DisplayObjectContainer.prototype.swapChildren = function(child, child2)
|
||||
{
|
||||
// TODO I already know this??
|
||||
var index = this.children.indexOf( child );
|
||||
var index2 = this.children.indexOf( child2 );
|
||||
|
||||
if ( index !== -1 && index2 !== -1 )
|
||||
{
|
||||
// cool
|
||||
if(this.stage)
|
||||
{
|
||||
// this is to satisfy the webGL batching..
|
||||
// TODO sure there is a nicer way to achieve this!
|
||||
this.stage.__removeChild(child);
|
||||
this.stage.__removeChild(child2);
|
||||
|
||||
this.stage.__addChild(child);
|
||||
this.stage.__addChild(child2);
|
||||
}
|
||||
|
||||
// swap the indexes..
|
||||
child.childIndex = index2;
|
||||
child2.childIndex = index;
|
||||
// swap the positions..
|
||||
this.children[index] = child2;
|
||||
this.children[index2] = child;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Error(child + " Both the supplied DisplayObjects must be a child of the caller " + this);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the Child at the specified index
|
||||
* @method getChildAt
|
||||
* @param index {Number}
|
||||
*/
|
||||
PIXI.DisplayObjectContainer.prototype.getChildAt = function(index)
|
||||
{
|
||||
if(index >= 0 && index < this.children.length)
|
||||
{
|
||||
return this.children[index];
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Error(child + " Both the supplied DisplayObjects must be a child of the caller " + this);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a child from the container.
|
||||
* @method removeChild
|
||||
|
@ -2033,8 +2091,7 @@ PIXI.WebGLRenderer.prototype.render = function(stage)
|
|||
{
|
||||
if(this.contextLost)return;
|
||||
|
||||
|
||||
|
||||
|
||||
// if rendering a new stage clear the batchs..
|
||||
if(this.__stage !== stage)
|
||||
{
|
||||
|
@ -2050,6 +2107,7 @@ PIXI.WebGLRenderer.prototype.render = function(stage)
|
|||
}
|
||||
|
||||
|
||||
|
||||
// update any textures
|
||||
for (var i=0; i < PIXI.texturesToUpdate.length; i++) this.updateTexture(PIXI.texturesToUpdate[i]);
|
||||
|
||||
|
|
|
@ -435,6 +435,64 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Swaps the depth of 2 displayObjects
|
||||
* @method swapChildren
|
||||
* @param DisplayObject {DisplayObject}
|
||||
* @param DisplayObject2 {DisplayObject}
|
||||
*/
|
||||
PIXI.DisplayObjectContainer.prototype.swapChildren = function(child, child2)
|
||||
{
|
||||
// TODO I already know this??
|
||||
var index = this.children.indexOf( child );
|
||||
var index2 = this.children.indexOf( child2 );
|
||||
|
||||
if ( index !== -1 && index2 !== -1 )
|
||||
{
|
||||
// cool
|
||||
if(this.stage)
|
||||
{
|
||||
// this is to satisfy the webGL batching..
|
||||
// TODO sure there is a nicer way to achieve this!
|
||||
this.stage.__removeChild(child);
|
||||
this.stage.__removeChild(child2);
|
||||
|
||||
this.stage.__addChild(child);
|
||||
this.stage.__addChild(child2);
|
||||
}
|
||||
|
||||
// swap the indexes..
|
||||
child.childIndex = index2;
|
||||
child2.childIndex = index;
|
||||
// swap the positions..
|
||||
this.children[index] = child2;
|
||||
this.children[index2] = child;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Error(child + " Both the supplied DisplayObjects must be a child of the caller " + this);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the Child at the specified index
|
||||
* @method getChildAt
|
||||
* @param index {Number}
|
||||
*/
|
||||
PIXI.DisplayObjectContainer.prototype.getChildAt = function(index)
|
||||
{
|
||||
if(index >= 0 && index < this.children.length)
|
||||
{
|
||||
return this.children[index];
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Error(child + " Both the supplied DisplayObjects must be a child of the caller " + this);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a child from the container.
|
||||
* @method removeChild
|
||||
|
@ -2033,8 +2091,7 @@ PIXI.WebGLRenderer.prototype.render = function(stage)
|
|||
{
|
||||
if(this.contextLost)return;
|
||||
|
||||
|
||||
|
||||
|
||||
// if rendering a new stage clear the batchs..
|
||||
if(this.__stage !== stage)
|
||||
{
|
||||
|
@ -2050,6 +2107,7 @@ PIXI.WebGLRenderer.prototype.render = function(stage)
|
|||
}
|
||||
|
||||
|
||||
|
||||
// update any textures
|
||||
for (var i=0; i < PIXI.texturesToUpdate.length; i++) this.updateTexture(PIXI.texturesToUpdate[i]);
|
||||
|
||||
|
|
|
@ -435,6 +435,64 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Swaps the depth of 2 displayObjects
|
||||
* @method swapChildren
|
||||
* @param DisplayObject {DisplayObject}
|
||||
* @param DisplayObject2 {DisplayObject}
|
||||
*/
|
||||
PIXI.DisplayObjectContainer.prototype.swapChildren = function(child, child2)
|
||||
{
|
||||
// TODO I already know this??
|
||||
var index = this.children.indexOf( child );
|
||||
var index2 = this.children.indexOf( child2 );
|
||||
|
||||
if ( index !== -1 && index2 !== -1 )
|
||||
{
|
||||
// cool
|
||||
if(this.stage)
|
||||
{
|
||||
// this is to satisfy the webGL batching..
|
||||
// TODO sure there is a nicer way to achieve this!
|
||||
this.stage.__removeChild(child);
|
||||
this.stage.__removeChild(child2);
|
||||
|
||||
this.stage.__addChild(child);
|
||||
this.stage.__addChild(child2);
|
||||
}
|
||||
|
||||
// swap the indexes..
|
||||
child.childIndex = index2;
|
||||
child2.childIndex = index;
|
||||
// swap the positions..
|
||||
this.children[index] = child2;
|
||||
this.children[index2] = child;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Error(child + " Both the supplied DisplayObjects must be a child of the caller " + this);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the Child at the specified index
|
||||
* @method getChildAt
|
||||
* @param index {Number}
|
||||
*/
|
||||
PIXI.DisplayObjectContainer.prototype.getChildAt = function(index)
|
||||
{
|
||||
if(index >= 0 && index < this.children.length)
|
||||
{
|
||||
return this.children[index];
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Error(child + " Both the supplied DisplayObjects must be a child of the caller " + this);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a child from the container.
|
||||
* @method removeChild
|
||||
|
@ -2033,8 +2091,7 @@ PIXI.WebGLRenderer.prototype.render = function(stage)
|
|||
{
|
||||
if(this.contextLost)return;
|
||||
|
||||
|
||||
|
||||
|
||||
// if rendering a new stage clear the batchs..
|
||||
if(this.__stage !== stage)
|
||||
{
|
||||
|
@ -2050,6 +2107,7 @@ PIXI.WebGLRenderer.prototype.render = function(stage)
|
|||
}
|
||||
|
||||
|
||||
|
||||
// update any textures
|
||||
for (var i=0; i < PIXI.texturesToUpdate.length; i++) this.updateTexture(PIXI.texturesToUpdate[i]);
|
||||
|
||||
|
|
|
@ -94,6 +94,64 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Swaps the depth of 2 displayObjects
|
||||
* @method swapChildren
|
||||
* @param DisplayObject {DisplayObject}
|
||||
* @param DisplayObject2 {DisplayObject}
|
||||
*/
|
||||
PIXI.DisplayObjectContainer.prototype.swapChildren = function(child, child2)
|
||||
{
|
||||
// TODO I already know this??
|
||||
var index = this.children.indexOf( child );
|
||||
var index2 = this.children.indexOf( child2 );
|
||||
|
||||
if ( index !== -1 && index2 !== -1 )
|
||||
{
|
||||
// cool
|
||||
if(this.stage)
|
||||
{
|
||||
// this is to satisfy the webGL batching..
|
||||
// TODO sure there is a nicer way to achieve this!
|
||||
this.stage.__removeChild(child);
|
||||
this.stage.__removeChild(child2);
|
||||
|
||||
this.stage.__addChild(child);
|
||||
this.stage.__addChild(child2);
|
||||
}
|
||||
|
||||
// swap the indexes..
|
||||
child.childIndex = index2;
|
||||
child2.childIndex = index;
|
||||
// swap the positions..
|
||||
this.children[index] = child2;
|
||||
this.children[index2] = child;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Error(child + " Both the supplied DisplayObjects must be a child of the caller " + this);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the Child at the specified index
|
||||
* @method getChildAt
|
||||
* @param index {Number}
|
||||
*/
|
||||
PIXI.DisplayObjectContainer.prototype.getChildAt = function(index)
|
||||
{
|
||||
if(index >= 0 && index < this.children.length)
|
||||
{
|
||||
return this.children[index];
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Error(child + " Both the supplied DisplayObjects must be a child of the caller " + this);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a child from the container.
|
||||
* @method removeChild
|
||||
|
|
|
@ -166,8 +166,7 @@ PIXI.WebGLRenderer.prototype.render = function(stage)
|
|||
{
|
||||
if(this.contextLost)return;
|
||||
|
||||
|
||||
|
||||
|
||||
// if rendering a new stage clear the batchs..
|
||||
if(this.__stage !== stage)
|
||||
{
|
||||
|
@ -183,6 +182,7 @@ PIXI.WebGLRenderer.prototype.render = function(stage)
|
|||
}
|
||||
|
||||
|
||||
|
||||
// update any textures
|
||||
for (var i=0; i < PIXI.texturesToUpdate.length; i++) this.updateTexture(PIXI.texturesToUpdate[i]);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue