Fixed graphics bug + updated docs
Fixed issue with getBounds being incorrect for graphics Updated docs Linted code
This commit is contained in:
parent
53506da65e
commit
7713731ab3
145 changed files with 15583 additions and 24078 deletions
|
@ -19,7 +19,7 @@
|
|||
|
||||
</div>
|
||||
<div class="yui3-u-1-4 version">
|
||||
<em>API Docs for: 1.3.0</em>
|
||||
<em>API Docs for: 1.4.0</em>
|
||||
</div>
|
||||
</div>
|
||||
<div id="bd" class="yui3-g">
|
||||
|
@ -45,6 +45,8 @@
|
|||
|
||||
<li><a href="../classes/AssetLoader.html">AssetLoader</a></li>
|
||||
|
||||
<li><a href="../classes/AtlasLoader.html">AtlasLoader</a></li>
|
||||
|
||||
<li><a href="../classes/BaseTexture.html">BaseTexture</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapFontLoader.html">BitmapFontLoader</a></li>
|
||||
|
@ -61,7 +63,7 @@
|
|||
|
||||
<li><a href="../classes/ColorMatrixFilter.html">ColorMatrixFilter</a></li>
|
||||
|
||||
<li><a href="../classes/CustomRenderable.html">CustomRenderable</a></li>
|
||||
<li><a href="../classes/ColorStepFilter.html">ColorStepFilter</a></li>
|
||||
|
||||
<li><a href="../classes/DisplacementFilter.html">DisplacementFilter</a></li>
|
||||
|
||||
|
@ -75,7 +77,7 @@
|
|||
|
||||
<li><a href="../classes/Graphics.html">Graphics</a></li>
|
||||
|
||||
<li><a href="../classes/GreyFilter.html">GreyFilter</a></li>
|
||||
<li><a href="../classes/GrayFilter.html">GrayFilter</a></li>
|
||||
|
||||
<li><a href="../classes/ImageLoader.html">ImageLoader</a></li>
|
||||
|
||||
|
@ -87,6 +89,8 @@
|
|||
|
||||
<li><a href="../classes/PixelateFilter.html">PixelateFilter</a></li>
|
||||
|
||||
<li><a href="../classes/PIXI.PixiShader.html">PIXI.PixiShader</a></li>
|
||||
|
||||
<li><a href="../classes/Point.html">Point</a></li>
|
||||
|
||||
<li><a href="../classes/Polygon.html">Polygon</a></li>
|
||||
|
@ -109,10 +113,10 @@
|
|||
|
||||
<li><a href="../classes/Spine.html">Spine</a></li>
|
||||
|
||||
<li><a href="../classes/Sprite.html">Sprite</a></li>
|
||||
|
||||
<li><a href="../classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
|
||||
|
||||
<li><a href="../classes/Sprite™.html">Sprite™</a></li>
|
||||
|
||||
<li><a href="../classes/Stage.html">Stage</a></li>
|
||||
|
||||
<li><a href="../classes/Text.html">Text</a></li>
|
||||
|
@ -121,8 +125,6 @@
|
|||
|
||||
<li><a href="../classes/TilingSprite.html">TilingSprite</a></li>
|
||||
|
||||
<li><a href="../classes/WebGLBatch.html">WebGLBatch</a></li>
|
||||
|
||||
<li><a href="../classes/WebGLRenderer.html">WebGLRenderer</a></li>
|
||||
|
||||
</ul>
|
||||
|
@ -175,7 +177,7 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* A Text Object will create a line(s) of text using bitmap font. To split a line you can use "\n", "\r" or "\r\n"
|
||||
* A Text Object will create a line(s) of text using bitmap font. To split a line you can use '\n', '\r' or '\r\n'
|
||||
* You can generate the fnt files using
|
||||
* http://www.angelcode.com/products/bmfont/ for windows or
|
||||
* http://www.bmglyph.com/ for mac.
|
||||
|
@ -185,8 +187,8 @@
|
|||
* @constructor
|
||||
* @param text {String} The copy that you would like the text to display
|
||||
* @param style {Object} The style parameters
|
||||
* @param style.font {String} The size (optional) and bitmap font id (required) eq "Arial" or "20px Arial" (must have loaded previously)
|
||||
* @param [style.align="left"] {String} An alignment of the multiline text ("left", "center" or "right")
|
||||
* @param style.font {String} The size (optional) and bitmap font id (required) eq 'Arial' or '20px Arial' (must have loaded previously)
|
||||
* @param [style.align='left'] {String} An alignment of the multiline text ('left', 'center' or 'right')
|
||||
*/
|
||||
PIXI.BitmapText = function(text, style)
|
||||
{
|
||||
|
@ -195,8 +197,7 @@ PIXI.BitmapText = function(text, style)
|
|||
this.setText(text);
|
||||
this.setStyle(style);
|
||||
this.updateText();
|
||||
this.dirty = false
|
||||
|
||||
this.dirty = false;
|
||||
};
|
||||
|
||||
// constructor
|
||||
|
@ -211,7 +212,7 @@ PIXI.BitmapText.prototype.constructor = PIXI.BitmapText;
|
|||
*/
|
||||
PIXI.BitmapText.prototype.setText = function(text)
|
||||
{
|
||||
this.text = text || " ";
|
||||
this.text = text || ' ';
|
||||
this.dirty = true;
|
||||
};
|
||||
|
||||
|
@ -220,16 +221,16 @@ PIXI.BitmapText.prototype.setText = function(text)
|
|||
*
|
||||
* @method setStyle
|
||||
* @param style {Object} The style parameters
|
||||
* @param style.font {String} The size (optional) and bitmap font id (required) eq "Arial" or "20px Arial" (must have loaded previously)
|
||||
* @param [style.align="left"] {String} An alignment of the multiline text ("left", "center" or "right")
|
||||
* @param style.font {String} The size (optional) and bitmap font id (required) eq 'Arial' or '20px Arial' (must have loaded previously)
|
||||
* @param [style.align='left'] {String} An alignment of the multiline text ('left', 'center' or 'right')
|
||||
*/
|
||||
PIXI.BitmapText.prototype.setStyle = function(style)
|
||||
{
|
||||
style = style || {};
|
||||
style.align = style.align || "left";
|
||||
style.align = style.align || 'left';
|
||||
this.style = style;
|
||||
|
||||
var font = style.font.split(" ");
|
||||
var font = style.font.split(' ');
|
||||
this.fontName = font[font.length - 1];
|
||||
this.fontSize = font.length >= 2 ? parseInt(font[font.length - 2], 10) : PIXI.BitmapText.fonts[this.fontName].size;
|
||||
|
||||
|
@ -272,7 +273,7 @@ PIXI.BitmapText.prototype.updateText = function()
|
|||
|
||||
if(prevCharCode && charData[prevCharCode])
|
||||
{
|
||||
pos.x += charData.kerning[prevCharCode];
|
||||
pos.x += charData.kerning[prevCharCode];
|
||||
}
|
||||
chars.push({texture:charData.texture, line: line, charCode: charCode, position: new PIXI.Point(pos.x + charData.xOffset, pos.y + charData.yOffset)});
|
||||
pos.x += charData.xAdvance;
|
||||
|
@ -287,11 +288,11 @@ PIXI.BitmapText.prototype.updateText = function()
|
|||
for(i = 0; i <= line; i++)
|
||||
{
|
||||
var alignOffset = 0;
|
||||
if(this.style.align == "right")
|
||||
if(this.style.align === 'right')
|
||||
{
|
||||
alignOffset = maxLineWidth - lineWidths[i];
|
||||
}
|
||||
else if(this.style.align == "center")
|
||||
else if(this.style.align === 'center')
|
||||
{
|
||||
alignOffset = (maxLineWidth - lineWidths[i]) / 2;
|
||||
}
|
||||
|
@ -300,14 +301,14 @@ PIXI.BitmapText.prototype.updateText = function()
|
|||
|
||||
for(i = 0; i < chars.length; i++)
|
||||
{
|
||||
var c = new PIXI.Sprite(chars[i].texture)//PIXI.Sprite.fromFrame(chars[i].charCode);
|
||||
var c = new PIXI.Sprite(chars[i].texture); //PIXI.Sprite.fromFrame(chars[i].charCode);
|
||||
c.position.x = (chars[i].position.x + lineAlignOffsets[chars[i].line]) * scale;
|
||||
c.position.y = chars[i].position.y * scale;
|
||||
c.scale.x = c.scale.y = scale;
|
||||
this.addChild(c);
|
||||
}
|
||||
|
||||
this.width = pos.x * scale;
|
||||
this.width = maxLineWidth * scale;
|
||||
this.height = (pos.y + data.lineHeight) * scale;
|
||||
};
|
||||
|
||||
|
@ -319,8 +320,8 @@ PIXI.BitmapText.prototype.updateText = function()
|
|||
*/
|
||||
PIXI.BitmapText.prototype.updateTransform = function()
|
||||
{
|
||||
if(this.dirty)
|
||||
{
|
||||
if(this.dirty)
|
||||
{
|
||||
while(this.children.length > 0)
|
||||
{
|
||||
this.removeChild(this.getChildAt(0));
|
||||
|
@ -328,9 +329,9 @@ PIXI.BitmapText.prototype.updateTransform = function()
|
|||
this.updateText();
|
||||
|
||||
this.dirty = false;
|
||||
}
|
||||
}
|
||||
|
||||
PIXI.DisplayObjectContainer.prototype.updateTransform.call(this);
|
||||
PIXI.DisplayObjectContainer.prototype.updateTransform.call(this);
|
||||
};
|
||||
|
||||
PIXI.BitmapText.fonts = {};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue