diff --git a/README.md b/README.md index 5c18489..0d81c81 100644 --- a/README.md +++ b/README.md @@ -1,52 +1,10 @@ Pixi Renderer ============= -## Rewrite TODO - -See: https://github.com/GoodBoyDigital/pixi.js/issues/1296 - - -### Phase 1 Folder Browserify Status - -- [x] `index` -- [x] `display/` -- [x] `extras/` -- [x] `filters/` -- [x] `geom/` (move to `math/`) -- [x] `loaders/` -- [x] `primitives/` -- [x] `renderers/` -- [x] `text/` -- [x] `textures/` -- [x] `utils/` -- [x] `interactions/` (move Interaction* to here) - - -#### *** IMPORTANT - V2 API CHANGES *** #### - -A heads up for anyone updating their version of pixi.js to version 2, as we have changed a couple of bits that you need to be aware of. Fortunately, there are only two changes, and both are small. - -1: Creating a renderer now accepts an options parameter that you can add specific settings to: -``` -// an optional object that contains the settings for the renderer -var options = { - view:myCanvas, - resolution:1 -}; - -var renderer = new PIXI.WebGLRenderer(800, 600, options) -``` - -2: A ```PIXI.RenderTexture``` now accepts a ```PIXI.Matrix``` as its second parameter instead of a point. This gives you much more flexibility: - -``` myRenderTexture.render(myDisplayObject, myMatrix) ``` - -Check out the docs for more info! - - ![pixi.js logo](http://www.goodboydigital.com/pixijs/logo_small.png) [](http://www.pixijs.com/projects) + #### JavaScript 2D Renderer #### The aim of this project is to provide a fast lightweight 2D library that works @@ -102,17 +60,6 @@ [Pixi.js forum]() - -### Road Map ### - -* Create a Typescript definition file for Pixi.js -* Implement Flash animation to pixi -* Update Loader so that it support XHR2 if it is available -* Improve the Documentation of the Project -* Create an Asset Loader Tutorial -* Create a MovieClip Tutorial -* Create a small game Tutorial - ### Contribute ### Want to be part of the pixi.js project? Great! All are welcome! We will get there quicker together :) @@ -151,11 +98,14 @@ ``` $> npm run docs ``` + There is also a gulp task to generate them if you want to: ``` -$> gulp docs +$> gulp jsdoc ``` -The documentation uses [DocStrap](https://github.com/terryweiss/docstrap) and the jsdoc format, the configuration file can be found at [gulp/utils/jsdoc.conf.json](https://github.com/GoodBoyDigital/pixi.js/blob/dev/gulp/util/jsdoc.conf.json) + +The documentation uses [DocStrap](https://github.com/terryweiss/docstrap) and the jsdoc format, the configuration +file can be found at [gulp/utils/jsdoc.conf.json](https://github.com/GoodBoyDigital/pixi.js/blob/dev/gulp/util/jsdoc.conf.json) ### Current features ### @@ -185,7 +135,7 @@ document.body.appendChild(renderer.view); - var stage = new PIXI.Stage(); + var stage = new PIXI.Container(); var bunnyTexture = PIXI.Texture.fromImage("bunny.png"); var bunny = new PIXI.Sprite(bunnyTexture); diff --git a/README.md b/README.md index 5c18489..0d81c81 100644 --- a/README.md +++ b/README.md @@ -1,52 +1,10 @@ Pixi Renderer ============= -## Rewrite TODO - -See: https://github.com/GoodBoyDigital/pixi.js/issues/1296 - - -### Phase 1 Folder Browserify Status - -- [x] `index` -- [x] `display/` -- [x] `extras/` -- [x] `filters/` -- [x] `geom/` (move to `math/`) -- [x] `loaders/` -- [x] `primitives/` -- [x] `renderers/` -- [x] `text/` -- [x] `textures/` -- [x] `utils/` -- [x] `interactions/` (move Interaction* to here) - - -#### *** IMPORTANT - V2 API CHANGES *** #### - -A heads up for anyone updating their version of pixi.js to version 2, as we have changed a couple of bits that you need to be aware of. Fortunately, there are only two changes, and both are small. - -1: Creating a renderer now accepts an options parameter that you can add specific settings to: -``` -// an optional object that contains the settings for the renderer -var options = { - view:myCanvas, - resolution:1 -}; - -var renderer = new PIXI.WebGLRenderer(800, 600, options) -``` - -2: A ```PIXI.RenderTexture``` now accepts a ```PIXI.Matrix``` as its second parameter instead of a point. This gives you much more flexibility: - -``` myRenderTexture.render(myDisplayObject, myMatrix) ``` - -Check out the docs for more info! - - ![pixi.js logo](http://www.goodboydigital.com/pixijs/logo_small.png) [](http://www.pixijs.com/projects) + #### JavaScript 2D Renderer #### The aim of this project is to provide a fast lightweight 2D library that works @@ -102,17 +60,6 @@ [Pixi.js forum]() - -### Road Map ### - -* Create a Typescript definition file for Pixi.js -* Implement Flash animation to pixi -* Update Loader so that it support XHR2 if it is available -* Improve the Documentation of the Project -* Create an Asset Loader Tutorial -* Create a MovieClip Tutorial -* Create a small game Tutorial - ### Contribute ### Want to be part of the pixi.js project? Great! All are welcome! We will get there quicker together :) @@ -151,11 +98,14 @@ ``` $> npm run docs ``` + There is also a gulp task to generate them if you want to: ``` -$> gulp docs +$> gulp jsdoc ``` -The documentation uses [DocStrap](https://github.com/terryweiss/docstrap) and the jsdoc format, the configuration file can be found at [gulp/utils/jsdoc.conf.json](https://github.com/GoodBoyDigital/pixi.js/blob/dev/gulp/util/jsdoc.conf.json) + +The documentation uses [DocStrap](https://github.com/terryweiss/docstrap) and the jsdoc format, the configuration +file can be found at [gulp/utils/jsdoc.conf.json](https://github.com/GoodBoyDigital/pixi.js/blob/dev/gulp/util/jsdoc.conf.json) ### Current features ### @@ -185,7 +135,7 @@ document.body.appendChild(renderer.view); - var stage = new PIXI.Stage(); + var stage = new PIXI.Container(); var bunnyTexture = PIXI.Texture.fromImage("bunny.png"); var bunny = new PIXI.Sprite(bunnyTexture); diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 024d155..521c869 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -15,7 +15,7 @@ * var sprite = new PIXI.Sprite.fromImage('assets/image.png'); * ``` * - * @class Sprite + * @class * @extends Container * @memberof PIXI * @param texture {Texture} The texture for this sprite diff --git a/README.md b/README.md index 5c18489..0d81c81 100644 --- a/README.md +++ b/README.md @@ -1,52 +1,10 @@ Pixi Renderer ============= -## Rewrite TODO - -See: https://github.com/GoodBoyDigital/pixi.js/issues/1296 - - -### Phase 1 Folder Browserify Status - -- [x] `index` -- [x] `display/` -- [x] `extras/` -- [x] `filters/` -- [x] `geom/` (move to `math/`) -- [x] `loaders/` -- [x] `primitives/` -- [x] `renderers/` -- [x] `text/` -- [x] `textures/` -- [x] `utils/` -- [x] `interactions/` (move Interaction* to here) - - -#### *** IMPORTANT - V2 API CHANGES *** #### - -A heads up for anyone updating their version of pixi.js to version 2, as we have changed a couple of bits that you need to be aware of. Fortunately, there are only two changes, and both are small. - -1: Creating a renderer now accepts an options parameter that you can add specific settings to: -``` -// an optional object that contains the settings for the renderer -var options = { - view:myCanvas, - resolution:1 -}; - -var renderer = new PIXI.WebGLRenderer(800, 600, options) -``` - -2: A ```PIXI.RenderTexture``` now accepts a ```PIXI.Matrix``` as its second parameter instead of a point. This gives you much more flexibility: - -``` myRenderTexture.render(myDisplayObject, myMatrix) ``` - -Check out the docs for more info! - - ![pixi.js logo](http://www.goodboydigital.com/pixijs/logo_small.png) [](http://www.pixijs.com/projects) + #### JavaScript 2D Renderer #### The aim of this project is to provide a fast lightweight 2D library that works @@ -102,17 +60,6 @@ [Pixi.js forum]() - -### Road Map ### - -* Create a Typescript definition file for Pixi.js -* Implement Flash animation to pixi -* Update Loader so that it support XHR2 if it is available -* Improve the Documentation of the Project -* Create an Asset Loader Tutorial -* Create a MovieClip Tutorial -* Create a small game Tutorial - ### Contribute ### Want to be part of the pixi.js project? Great! All are welcome! We will get there quicker together :) @@ -151,11 +98,14 @@ ``` $> npm run docs ``` + There is also a gulp task to generate them if you want to: ``` -$> gulp docs +$> gulp jsdoc ``` -The documentation uses [DocStrap](https://github.com/terryweiss/docstrap) and the jsdoc format, the configuration file can be found at [gulp/utils/jsdoc.conf.json](https://github.com/GoodBoyDigital/pixi.js/blob/dev/gulp/util/jsdoc.conf.json) + +The documentation uses [DocStrap](https://github.com/terryweiss/docstrap) and the jsdoc format, the configuration +file can be found at [gulp/utils/jsdoc.conf.json](https://github.com/GoodBoyDigital/pixi.js/blob/dev/gulp/util/jsdoc.conf.json) ### Current features ### @@ -185,7 +135,7 @@ document.body.appendChild(renderer.view); - var stage = new PIXI.Stage(); + var stage = new PIXI.Container(); var bunnyTexture = PIXI.Texture.fromImage("bunny.png"); var bunny = new PIXI.Sprite(bunnyTexture); diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 024d155..521c869 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -15,7 +15,7 @@ * var sprite = new PIXI.Sprite.fromImage('assets/image.png'); * ``` * - * @class Sprite + * @class * @extends Container * @memberof PIXI * @param texture {Texture} The texture for this sprite diff --git a/src/extras/MovieClip.js b/src/extras/MovieClip.js index 359200c..40f5212 100644 --- a/src/extras/MovieClip.js +++ b/src/extras/MovieClip.js @@ -1,11 +1,22 @@ var core = require('../core'), utils = require('../core/utils'); - - /** * A MovieClip is a simple way to display an animation depicted by a list of textures. * + * ```js + * var alienImages = ["image_sequence_01.png","image_sequence_02.png","image_sequence_03.png","image_sequence_04.png"]; + * var textureArray = []; + * + * for (var i=0; i < 4; i++) + * { + * var texture = PIXI.Texture.fromImage(alienImages[i]); + * textureArray.push(texture); + * }; + * + * var mc = new PIXI.MovieClip(textureArray); + * ``` + * * @class * @extends Sprite * @memberof PIXI.extras @@ -214,7 +225,10 @@ } }; - +/* + * Stops the MovieClip and destroys it + * + */ MovieClip.prototype.destroy = function ( ) { this.stop(); diff --git a/README.md b/README.md index 5c18489..0d81c81 100644 --- a/README.md +++ b/README.md @@ -1,52 +1,10 @@ Pixi Renderer ============= -## Rewrite TODO - -See: https://github.com/GoodBoyDigital/pixi.js/issues/1296 - - -### Phase 1 Folder Browserify Status - -- [x] `index` -- [x] `display/` -- [x] `extras/` -- [x] `filters/` -- [x] `geom/` (move to `math/`) -- [x] `loaders/` -- [x] `primitives/` -- [x] `renderers/` -- [x] `text/` -- [x] `textures/` -- [x] `utils/` -- [x] `interactions/` (move Interaction* to here) - - -#### *** IMPORTANT - V2 API CHANGES *** #### - -A heads up for anyone updating their version of pixi.js to version 2, as we have changed a couple of bits that you need to be aware of. Fortunately, there are only two changes, and both are small. - -1: Creating a renderer now accepts an options parameter that you can add specific settings to: -``` -// an optional object that contains the settings for the renderer -var options = { - view:myCanvas, - resolution:1 -}; - -var renderer = new PIXI.WebGLRenderer(800, 600, options) -``` - -2: A ```PIXI.RenderTexture``` now accepts a ```PIXI.Matrix``` as its second parameter instead of a point. This gives you much more flexibility: - -``` myRenderTexture.render(myDisplayObject, myMatrix) ``` - -Check out the docs for more info! - - ![pixi.js logo](http://www.goodboydigital.com/pixijs/logo_small.png) [](http://www.pixijs.com/projects) + #### JavaScript 2D Renderer #### The aim of this project is to provide a fast lightweight 2D library that works @@ -102,17 +60,6 @@ [Pixi.js forum]() - -### Road Map ### - -* Create a Typescript definition file for Pixi.js -* Implement Flash animation to pixi -* Update Loader so that it support XHR2 if it is available -* Improve the Documentation of the Project -* Create an Asset Loader Tutorial -* Create a MovieClip Tutorial -* Create a small game Tutorial - ### Contribute ### Want to be part of the pixi.js project? Great! All are welcome! We will get there quicker together :) @@ -151,11 +98,14 @@ ``` $> npm run docs ``` + There is also a gulp task to generate them if you want to: ``` -$> gulp docs +$> gulp jsdoc ``` -The documentation uses [DocStrap](https://github.com/terryweiss/docstrap) and the jsdoc format, the configuration file can be found at [gulp/utils/jsdoc.conf.json](https://github.com/GoodBoyDigital/pixi.js/blob/dev/gulp/util/jsdoc.conf.json) + +The documentation uses [DocStrap](https://github.com/terryweiss/docstrap) and the jsdoc format, the configuration +file can be found at [gulp/utils/jsdoc.conf.json](https://github.com/GoodBoyDigital/pixi.js/blob/dev/gulp/util/jsdoc.conf.json) ### Current features ### @@ -185,7 +135,7 @@ document.body.appendChild(renderer.view); - var stage = new PIXI.Stage(); + var stage = new PIXI.Container(); var bunnyTexture = PIXI.Texture.fromImage("bunny.png"); var bunny = new PIXI.Sprite(bunnyTexture); diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 024d155..521c869 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -15,7 +15,7 @@ * var sprite = new PIXI.Sprite.fromImage('assets/image.png'); * ``` * - * @class Sprite + * @class * @extends Container * @memberof PIXI * @param texture {Texture} The texture for this sprite diff --git a/src/extras/MovieClip.js b/src/extras/MovieClip.js index 359200c..40f5212 100644 --- a/src/extras/MovieClip.js +++ b/src/extras/MovieClip.js @@ -1,11 +1,22 @@ var core = require('../core'), utils = require('../core/utils'); - - /** * A MovieClip is a simple way to display an animation depicted by a list of textures. * + * ```js + * var alienImages = ["image_sequence_01.png","image_sequence_02.png","image_sequence_03.png","image_sequence_04.png"]; + * var textureArray = []; + * + * for (var i=0; i < 4; i++) + * { + * var texture = PIXI.Texture.fromImage(alienImages[i]); + * textureArray.push(texture); + * }; + * + * var mc = new PIXI.MovieClip(textureArray); + * ``` + * * @class * @extends Sprite * @memberof PIXI.extras @@ -214,7 +225,10 @@ } }; - +/* + * Stops the MovieClip and destroys it + * + */ MovieClip.prototype.destroy = function ( ) { this.stop(); diff --git a/src/loaders/loader.js b/src/loaders/loader.js index 49ae91c..d022f1e 100644 --- a/src/loaders/loader.js +++ b/src/loaders/loader.js @@ -3,8 +3,25 @@ spritesheetParser = require('./spritesheetParser'), spineAtlasParser = require('./spineAtlasParser'), bitmapFontParser = require('./bitmapFontParser'); - // loader = new Loader(); +/** + * + * The new loader, extends Resource Loader by Chad Engler : https://github.com/englercj/resource-loader + * + * ```js + * var loader = new PIXI.loader(); + * + * loader.add('spineboy',"data/spineboy.json"); + * + * loader.once('complete',onAssetsLoaded); + * + * loader.load(); + * ``` + * + * @class + * @extends ResourceLoader + * @memberof PIXI.loaders + */ var Loader = function() { ResourceLoader.call(this); diff --git a/README.md b/README.md index 5c18489..0d81c81 100644 --- a/README.md +++ b/README.md @@ -1,52 +1,10 @@ Pixi Renderer ============= -## Rewrite TODO - -See: https://github.com/GoodBoyDigital/pixi.js/issues/1296 - - -### Phase 1 Folder Browserify Status - -- [x] `index` -- [x] `display/` -- [x] `extras/` -- [x] `filters/` -- [x] `geom/` (move to `math/`) -- [x] `loaders/` -- [x] `primitives/` -- [x] `renderers/` -- [x] `text/` -- [x] `textures/` -- [x] `utils/` -- [x] `interactions/` (move Interaction* to here) - - -#### *** IMPORTANT - V2 API CHANGES *** #### - -A heads up for anyone updating their version of pixi.js to version 2, as we have changed a couple of bits that you need to be aware of. Fortunately, there are only two changes, and both are small. - -1: Creating a renderer now accepts an options parameter that you can add specific settings to: -``` -// an optional object that contains the settings for the renderer -var options = { - view:myCanvas, - resolution:1 -}; - -var renderer = new PIXI.WebGLRenderer(800, 600, options) -``` - -2: A ```PIXI.RenderTexture``` now accepts a ```PIXI.Matrix``` as its second parameter instead of a point. This gives you much more flexibility: - -``` myRenderTexture.render(myDisplayObject, myMatrix) ``` - -Check out the docs for more info! - - ![pixi.js logo](http://www.goodboydigital.com/pixijs/logo_small.png) [](http://www.pixijs.com/projects) + #### JavaScript 2D Renderer #### The aim of this project is to provide a fast lightweight 2D library that works @@ -102,17 +60,6 @@ [Pixi.js forum]() - -### Road Map ### - -* Create a Typescript definition file for Pixi.js -* Implement Flash animation to pixi -* Update Loader so that it support XHR2 if it is available -* Improve the Documentation of the Project -* Create an Asset Loader Tutorial -* Create a MovieClip Tutorial -* Create a small game Tutorial - ### Contribute ### Want to be part of the pixi.js project? Great! All are welcome! We will get there quicker together :) @@ -151,11 +98,14 @@ ``` $> npm run docs ``` + There is also a gulp task to generate them if you want to: ``` -$> gulp docs +$> gulp jsdoc ``` -The documentation uses [DocStrap](https://github.com/terryweiss/docstrap) and the jsdoc format, the configuration file can be found at [gulp/utils/jsdoc.conf.json](https://github.com/GoodBoyDigital/pixi.js/blob/dev/gulp/util/jsdoc.conf.json) + +The documentation uses [DocStrap](https://github.com/terryweiss/docstrap) and the jsdoc format, the configuration +file can be found at [gulp/utils/jsdoc.conf.json](https://github.com/GoodBoyDigital/pixi.js/blob/dev/gulp/util/jsdoc.conf.json) ### Current features ### @@ -185,7 +135,7 @@ document.body.appendChild(renderer.view); - var stage = new PIXI.Stage(); + var stage = new PIXI.Container(); var bunnyTexture = PIXI.Texture.fromImage("bunny.png"); var bunny = new PIXI.Sprite(bunnyTexture); diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 024d155..521c869 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -15,7 +15,7 @@ * var sprite = new PIXI.Sprite.fromImage('assets/image.png'); * ``` * - * @class Sprite + * @class * @extends Container * @memberof PIXI * @param texture {Texture} The texture for this sprite diff --git a/src/extras/MovieClip.js b/src/extras/MovieClip.js index 359200c..40f5212 100644 --- a/src/extras/MovieClip.js +++ b/src/extras/MovieClip.js @@ -1,11 +1,22 @@ var core = require('../core'), utils = require('../core/utils'); - - /** * A MovieClip is a simple way to display an animation depicted by a list of textures. * + * ```js + * var alienImages = ["image_sequence_01.png","image_sequence_02.png","image_sequence_03.png","image_sequence_04.png"]; + * var textureArray = []; + * + * for (var i=0; i < 4; i++) + * { + * var texture = PIXI.Texture.fromImage(alienImages[i]); + * textureArray.push(texture); + * }; + * + * var mc = new PIXI.MovieClip(textureArray); + * ``` + * * @class * @extends Sprite * @memberof PIXI.extras @@ -214,7 +225,10 @@ } }; - +/* + * Stops the MovieClip and destroys it + * + */ MovieClip.prototype.destroy = function ( ) { this.stop(); diff --git a/src/loaders/loader.js b/src/loaders/loader.js index 49ae91c..d022f1e 100644 --- a/src/loaders/loader.js +++ b/src/loaders/loader.js @@ -3,8 +3,25 @@ spritesheetParser = require('./spritesheetParser'), spineAtlasParser = require('./spineAtlasParser'), bitmapFontParser = require('./bitmapFontParser'); - // loader = new Loader(); +/** + * + * The new loader, extends Resource Loader by Chad Engler : https://github.com/englercj/resource-loader + * + * ```js + * var loader = new PIXI.loader(); + * + * loader.add('spineboy',"data/spineboy.json"); + * + * loader.once('complete',onAssetsLoaded); + * + * loader.load(); + * ``` + * + * @class + * @extends ResourceLoader + * @memberof PIXI.loaders + */ var Loader = function() { ResourceLoader.call(this); diff --git a/src/spine/Spine.js b/src/spine/Spine.js index 22e799d..58645ae 100644 --- a/src/spine/Spine.js +++ b/src/spine/Spine.js @@ -7,9 +7,13 @@ /** * A class that enables the you to import and run your spine animations in pixi. - * Spine animation data needs to be loaded using the AssetLoader or SpineLoader before it can be used by this class + * The Spine animation data needs to be loaded using either the Loader or a SpineLoader before it can be used by this class * See example 12 (http://www.goodboydigital.com/pixijs/examples/12/) to see a working example and check out the source * + * ```js + * var spineAnimation = new PIXI.Spine(spineData); + * ``` + * * @class * @extends Container * @memberof PIXI.spine