Text added to PIXI
destroy function added to textures too docs updated new example added
This commit is contained in:
parent
7933cadb77
commit
09dbbd5d13
66 changed files with 10970 additions and 681 deletions
|
@ -67,6 +67,8 @@
|
|||
|
||||
<li><a href="../classes/Stage.html">Stage</a></li>
|
||||
|
||||
<li><a href="../classes/Text.html">Text</a></li>
|
||||
|
||||
<li><a href="../classes/Texture.html">Texture</a></li>
|
||||
|
||||
<li><a href="../classes/TilingSprite.html">TilingSprite</a></li>
|
||||
|
@ -146,6 +148,9 @@ PIXI.Texture = function(baseTexture, frame)
|
|||
}
|
||||
|
||||
this.trim = new PIXI.Point();
|
||||
|
||||
if(baseTexture instanceof PIXI.Texture)
|
||||
baseTexture = baseTexture.baseTexture;
|
||||
|
||||
/**
|
||||
* The base texture of this texture
|
||||
|
@ -194,6 +199,11 @@ PIXI.Texture.prototype.onBaseTextureLoaded = function(event)
|
|||
this.scope.dispatchEvent( { type: 'update', content: this } );
|
||||
}
|
||||
|
||||
PIXI.Texture.prototype.destroy = function(destroyBase)
|
||||
{
|
||||
if(destroyBase)this.baseTexture.destroy();
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies the rectangle region of the baseTexture
|
||||
* @method setFrame
|
||||
|
@ -209,7 +219,11 @@ PIXI.Texture.prototype.setFrame = function(frame)
|
|||
{
|
||||
throw new Error("Texture Error: frame does not fit inside the base Texture dimensions " + this);
|
||||
}
|
||||
//this.updateFrame = true;
|
||||
|
||||
this.updateFrame = true;
|
||||
|
||||
PIXI.Texture.frameUpdates.push(this);
|
||||
//this.dispatchEvent( { type: 'update', content: this } );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -227,24 +241,8 @@ PIXI.Texture.fromImage = function(imageUrl, crossorigin)
|
|||
|
||||
if(!texture)
|
||||
{
|
||||
var baseTexture = PIXI.BaseTextureCache[imageUrl];
|
||||
if(!baseTexture)
|
||||
{
|
||||
var image = new Image();//new Image();
|
||||
if (crossorigin)
|
||||
{
|
||||
image.crossOrigin = '';
|
||||
}
|
||||
image.src = imageUrl;
|
||||
baseTexture = new PIXI.BaseTexture(image);
|
||||
PIXI.BaseTextureCache[imageUrl] = baseTexture;
|
||||
}
|
||||
texture = new PIXI.Texture(baseTexture);
|
||||
|
||||
|
||||
texture = new PIXI.Texture(PIXI.BaseTexture.fromImage(imageUrl, crossorigin));
|
||||
PIXI.TextureCache[imageUrl] = texture;
|
||||
|
||||
|
||||
}
|
||||
|
||||
return texture;
|
||||
|
@ -307,6 +305,9 @@ PIXI.Texture.removeTextureFromCache = function(id)
|
|||
return texture;
|
||||
}
|
||||
|
||||
// this is more for webGL.. it contains updated frames..
|
||||
PIXI.Texture.frameUpdates = [];
|
||||
|
||||
|
||||
</pre>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue