diff --git a/README.md b/README.md index 44bb127..11c0769 100644 --- a/README.md +++ b/README.md @@ -78,13 +78,14 @@ - Auto-detect which renderer should be used - Full Mouse and Multi-touch Interaction - Text +- BitmapFont text +- Multiline Text ### Coming soon ### - Filters - Render Texture -- BitmapFont text -- Multiline Text + ### Coming later ### diff --git a/README.md b/README.md index 44bb127..11c0769 100644 --- a/README.md +++ b/README.md @@ -78,13 +78,14 @@ - Auto-detect which renderer should be used - Full Mouse and Multi-touch Interaction - Text +- BitmapFont text +- Multiline Text ### Coming soon ### - Filters - Render Texture -- BitmapFont text -- Multiline Text + ### Coming later ### diff --git a/src/pixi/Point.js b/src/pixi/Point.js index 0e0884a..6fd5295 100644 --- a/src/pixi/Point.js +++ b/src/pixi/Point.js @@ -30,7 +30,7 @@ * @method clone * @return a copy of the point */ -PIXI.Point.clone = function() +PIXI.Point.prototype.clone = function() { return new PIXI.Point(this.x, this.y); } diff --git a/README.md b/README.md index 44bb127..11c0769 100644 --- a/README.md +++ b/README.md @@ -78,13 +78,14 @@ - Auto-detect which renderer should be used - Full Mouse and Multi-touch Interaction - Text +- BitmapFont text +- Multiline Text ### Coming soon ### - Filters - Render Texture -- BitmapFont text -- Multiline Text + ### Coming later ### diff --git a/src/pixi/Point.js b/src/pixi/Point.js index 0e0884a..6fd5295 100644 --- a/src/pixi/Point.js +++ b/src/pixi/Point.js @@ -30,7 +30,7 @@ * @method clone * @return a copy of the point */ -PIXI.Point.clone = function() +PIXI.Point.prototype.clone = function() { return new PIXI.Point(this.x, this.y); } diff --git a/src/pixi/Rectangle.js b/src/pixi/Rectangle.js index eeecc06..f3513eb 100644 --- a/src/pixi/Rectangle.js +++ b/src/pixi/Rectangle.js @@ -46,7 +46,7 @@ * @method clone * @return a copy of the rectangle */ -PIXI.Rectangle.clone = function() +PIXI.Rectangle.prototype.clone = function() { return new PIXI.Rectangle(this.x, this.y, this.width, this.height); } diff --git a/README.md b/README.md index 44bb127..11c0769 100644 --- a/README.md +++ b/README.md @@ -78,13 +78,14 @@ - Auto-detect which renderer should be used - Full Mouse and Multi-touch Interaction - Text +- BitmapFont text +- Multiline Text ### Coming soon ### - Filters - Render Texture -- BitmapFont text -- Multiline Text + ### Coming later ### diff --git a/src/pixi/Point.js b/src/pixi/Point.js index 0e0884a..6fd5295 100644 --- a/src/pixi/Point.js +++ b/src/pixi/Point.js @@ -30,7 +30,7 @@ * @method clone * @return a copy of the point */ -PIXI.Point.clone = function() +PIXI.Point.prototype.clone = function() { return new PIXI.Point(this.x, this.y); } diff --git a/src/pixi/Rectangle.js b/src/pixi/Rectangle.js index eeecc06..f3513eb 100644 --- a/src/pixi/Rectangle.js +++ b/src/pixi/Rectangle.js @@ -46,7 +46,7 @@ * @method clone * @return a copy of the rectangle */ -PIXI.Rectangle.clone = function() +PIXI.Rectangle.prototype.clone = function() { return new PIXI.Rectangle(this.x, this.y, this.width, this.height); } diff --git a/src/pixi/extras/TilingSprite.js b/src/pixi/extras/TilingSprite.js index 076f153..14c3a74 100644 --- a/src/pixi/extras/TilingSprite.js +++ b/src/pixi/extras/TilingSprite.js @@ -25,7 +25,7 @@ * @property tileScale * @type Point */ - this.tileScale = new PIXI.Point(2,1); + this.tileScale = new PIXI.Point(1,1); /** * The offset position of the image that is being tiled * @property tileScale diff --git a/README.md b/README.md index 44bb127..11c0769 100644 --- a/README.md +++ b/README.md @@ -78,13 +78,14 @@ - Auto-detect which renderer should be used - Full Mouse and Multi-touch Interaction - Text +- BitmapFont text +- Multiline Text ### Coming soon ### - Filters - Render Texture -- BitmapFont text -- Multiline Text + ### Coming later ### diff --git a/src/pixi/Point.js b/src/pixi/Point.js index 0e0884a..6fd5295 100644 --- a/src/pixi/Point.js +++ b/src/pixi/Point.js @@ -30,7 +30,7 @@ * @method clone * @return a copy of the point */ -PIXI.Point.clone = function() +PIXI.Point.prototype.clone = function() { return new PIXI.Point(this.x, this.y); } diff --git a/src/pixi/Rectangle.js b/src/pixi/Rectangle.js index eeecc06..f3513eb 100644 --- a/src/pixi/Rectangle.js +++ b/src/pixi/Rectangle.js @@ -46,7 +46,7 @@ * @method clone * @return a copy of the rectangle */ -PIXI.Rectangle.clone = function() +PIXI.Rectangle.prototype.clone = function() { return new PIXI.Rectangle(this.x, this.y, this.width, this.height); } diff --git a/src/pixi/extras/TilingSprite.js b/src/pixi/extras/TilingSprite.js index 076f153..14c3a74 100644 --- a/src/pixi/extras/TilingSprite.js +++ b/src/pixi/extras/TilingSprite.js @@ -25,7 +25,7 @@ * @property tileScale * @type Point */ - this.tileScale = new PIXI.Point(2,1); + this.tileScale = new PIXI.Point(1,1); /** * The offset position of the image that is being tiled * @property tileScale diff --git a/src/pixi/text/BitmapText.js b/src/pixi/text/BitmapText.js index 6f5edf9..fe46ab4 100644 --- a/src/pixi/text/BitmapText.js +++ b/src/pixi/text/BitmapText.js @@ -3,19 +3,18 @@ */ /** - * A Text Object will create a line(s) of text using bitmap font + * 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 of + * http://www.angelcode.com/products/bmfont/ for windows or * http://www.bmglyph.com/ for mac. * @class BitmapText * @extends DisplayObjectContainer * @constructor * @param {String} text The copy that you would like the text to display - * @param {Object} [style] The style parameters - * @param {String} [style.font] default is "20pt Arial" The size and bitmap font id (must have loaded previously) + * @param {Object} style The style parameters + * @param {String} style.font The size (optional) and bitmap font id (required) eq "Arial" or "20px Arial" (must have loaded previously) * @param {String} [style.align="left"] An alignment of the multiline text ("left", "center" or "right") */ - //* @param {Object} [style.font="bold 20pt Arial"] The style and size of the font PIXI.BitmapText = function(text, style) { PIXI.DisplayObjectContainer.call(this); @@ -33,7 +32,7 @@ /** * Set the copy for the text object - * @methos setText + * @method setText * @param {String} text The copy that you would like the text to display */ PIXI.BitmapText.prototype.setText = function(text) @@ -45,8 +44,8 @@ /** * Set the style of the text * @method setStyle - * @param {Object} [style] The style parameters - * @param {Object} style.font The style and size of the font. If font size is not specified, it uses default bitmap font size. Font name is required + * @param {Object} style The style parameters + * @param {String} style.font The size (optional) and bitmap font id (required) eq "Arial" or "20px Arial" (must have loaded previously) * @param {String} [style.align="left"] An alignment of the multiline text ("left", "center" or "right") */ PIXI.BitmapText.prototype.setStyle = function(style) @@ -79,7 +78,7 @@ for(var i = 0; i < this.text.length; i++) { var charCode = this.text.charCodeAt(i); - if(charCode == "\n".charCodeAt(0)) + if(/(?:\r\n|\r|\n)/.test(this.text.charAt(i))) { lineWidths.push(pos.x); maxLineWidth = Math.max(maxLineWidth, pos.x);