RenderTexture update

RenderTexture added (webGL and Canvas)
WebGL Render rearchitected - a little faster :)
Pivot added to DisplayObject
docs updated
grunt file updated
This commit is contained in:
Mat Groves 2013-05-22 18:44:20 +01:00
parent ba5a79c606
commit 88b863155a
82 changed files with 14133 additions and 6332 deletions

View file

@ -67,6 +67,8 @@
<li><a href="..&#x2F;classes/Rectangle.html">Rectangle</a></li>
<li><a href="..&#x2F;classes/RenderTexture.html">RenderTexture</a></li>
<li><a href="..&#x2F;classes/Sprite.html">Sprite</a></li>
<li><a href="..&#x2F;classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
@ -165,17 +167,27 @@ PIXI.DisplayObjectContainer.prototype.addChild = function(child)
{
if(child.parent != undefined)
{
child.parent.removeChild(child)
child.parent.removeChild(child);
}
child.parent = this;
child.childIndex = this.children.length;
this.children.push(child);
if(this.stage)
{
this.stage.__addChild(child);
}
&#x2F;&#x2F; need to remove any render groups..
if(this.__renderGroup)
{
&#x2F;&#x2F; being used by a renderTexture.. if it exists then it must be from a render texture;
if(child.__renderGroup)child.__renderGroup.removeDisplayObjectAndChildren(child);
&#x2F;&#x2F; add them to the new render group..
this.__renderGroup.addDisplayObjectAndChildren(child);
}
}
&#x2F;**
@ -215,6 +227,12 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
{
this.stage.__addChild(child);
}
&#x2F;&#x2F; little webGL!
if(this.__renderGroup)
{
this.__renderGroup.addDisplayObjectAndChildren(child);
}
}
else
{
@ -290,12 +308,23 @@ PIXI.DisplayObjectContainer.prototype.getChildAt = function(index)
PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
{
var index = this.children.indexOf( child );
if ( index !== -1 )
{
if(this.stage)this.stage.__removeChild(child);
if(this.stage)
{
this.stage.__removeChild(child);
}
&#x2F;&#x2F; console.log(child.__renderGroup);
if(child.__renderGroup)
{
&#x2F;&#x2F; console.log(&quot;&gt;?&quot;)
child.__renderGroup.removeDisplayObjectAndChildren(child);
}
&#x2F;&#x2F; console.log(&quot;&gt;&quot; + child.__renderGroup)
child.parent = undefined;
&#x2F;&#x2F;child.childIndex = 0
this.children.splice( index, 1 );
&#x2F;&#x2F; update in dexs!