Skip to content

Commit

Permalink
Improved docs and made release build.
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewstart committed Aug 25, 2015
1 parent 9a7f55c commit c11628e
Show file tree
Hide file tree
Showing 9 changed files with 135 additions and 17 deletions.
41 changes: 38 additions & 3 deletions dist/modules/animated-particle.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*! PixiParticles 1.5.0 */
/**
* @module cloudkid
* @module Animated Particle
* @namespace cloudkid
*/
(function(cloudkid, undefined) {

Expand All @@ -12,8 +13,34 @@
var useAPI3 = ParticleUtils.useAPI3;

/**
* An individual particle image with an animation. While this class may be functional, it
* has not gotten thorough testing or examples yet, and is not considered to be release ready.
* An individual particle image with an animation. Art data passed to the emitter must be
* formatted in a particular way for AnimatedParticle to be able to handle it:
*
* {
* //framerate is required. It is the animation speed of the particle in frames per
* //second.
* //A value of "matchLife" causes the animation to match the lifetime of an individual
* //particle, instead of at a constant framerate. This causes the animation to play
* //through one time, completing when the particle expires.
* framerate: 6,
* //loop is optional, and defaults to false.
* loop: true,
* //textures is required, and can be an array of any (non-zero) length.
* textures: [
* //each entry represents a single texture that should be used for one or more
* //frames. Any strings will be converted to Textures with Texture.fromImage().
* //Instances of PIXI.Texture will be used directly.
* "animFrame1.png",
* //entries can be an object with a 'count' property, telling AnimatedParticle to
* //use that texture for 'count' frames sequentially.
* {
* texture: "animFrame2.png",
* count: 3
* },
* "animFrame3.png"
* ]
* }
*
* @class AnimatedParticle
* @constructor
* @param {Emitter} emitter The emitter that controls this AnimatedParticle.
Expand Down Expand Up @@ -132,6 +159,14 @@
s.destroy.call(this);
};

/**
* Checks over the art that was passed to the Emitter's init() function, to do any special
* modifications to prepare it ahead of time.
* @method parseArt
* @static
* @param {Array} art The array of art data, properly formatted for AnimatedParticle.
* @return {Array} The art, after any needed modifications.
*/
AnimatedParticle.parseArt = function(art)
{
var i, data, output = [], j, textures, tex, outTextures;
Expand Down
7 changes: 6 additions & 1 deletion dist/modules/path-particle.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*! PixiParticles 1.5.0 */
/**
* @module cloudkid
* @module Path Particle
* @namespace cloudkid
*/
(function(cloudkid, undefined) {

Expand Down Expand Up @@ -185,6 +186,8 @@
/**
* Checks over the art that was passed to the Emitter's init() function, to do any special
* modifications to prepare it ahead of time. This just runs Particle.parseArt().
* @method parseArt
* @static
* @param {Array} art The array of art data. For Particle, it should be an array of Textures.
* Any strings in the array will be converted to Textures via
* Texture.fromImage().
Expand All @@ -199,6 +202,8 @@
* Parses extra emitter data to ensure it is set up for this particle class.
* PathParticle checks for the existence of path data, and parses the path data for use
* by particle instances.
* @method parseData
* @static
* @param {Object} extraData The extra data from the particle config.
* @return {Object} The parsed extra data.
*/
Expand Down
27 changes: 23 additions & 4 deletions dist/pixi-particles.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*! PixiParticles 1.5.0 */
/**
* @module cloudkid
* @module Pixi Particles
* @namespace cloudkid
*/
(function(undefined) {

Expand Down Expand Up @@ -182,7 +183,8 @@
cloudkid.ParticleUtils = ParticleUtils;

/**
* @module global
* @module Pixi Particles
* @namespace window
*/
/**
* Add methods to Array
Expand Down Expand Up @@ -226,7 +228,8 @@
}
}());
/**
* @module cloudkid
* @module Pixi Particles
* @namespace cloudkid
*/
(function(cloudkid, undefined) {

Expand Down Expand Up @@ -633,6 +636,8 @@
/**
* Checks over the art that was passed to the Emitter's init() function, to do any special
* modifications to prepare it ahead of time.
* @method parseArt
* @static
* @param {Array} art The array of art data. For Particle, it should be an array of Textures.
* Any strings in the array will be converted to Textures via
* Texture.fromImage().
Expand Down Expand Up @@ -664,13 +669,27 @@

return art;
};

/**
* Parses extra emitter data to ensure it is set up for this particle class.
* Particle does nothing to the extra data.
* @method parseData
* @static
* @param {Object} extraData The extra data from the particle config.
* @return {Object} The parsed extra data.
*/
Particle.parseData = function(extraData)
{
return extraData;
};

cloudkid.Particle = Particle;

}(cloudkid));

/**
* @module cloudkid
* @module Pixi Particles
* @namespace cloudkid
*/
(function(cloudkid, undefined) {

Expand Down
2 changes: 1 addition & 1 deletion dist/pixi-particles.min.js

Large diffs are not rendered by default.

41 changes: 38 additions & 3 deletions src/AnimatedParticle.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/**
* @module cloudkid
* @module Animated Particle
* @namespace cloudkid
*/
(function(cloudkid, undefined) {

Expand All @@ -11,8 +12,34 @@
var useAPI3 = ParticleUtils.useAPI3;

/**
* An individual particle image with an animation. While this class may be functional, it
* has not gotten thorough testing or examples yet, and is not considered to be release ready.
* An individual particle image with an animation. Art data passed to the emitter must be
* formatted in a particular way for AnimatedParticle to be able to handle it:
*
* {
* //framerate is required. It is the animation speed of the particle in frames per
* //second.
* //A value of "matchLife" causes the animation to match the lifetime of an individual
* //particle, instead of at a constant framerate. This causes the animation to play
* //through one time, completing when the particle expires.
* framerate: 6,
* //loop is optional, and defaults to false.
* loop: true,
* //textures is required, and can be an array of any (non-zero) length.
* textures: [
* //each entry represents a single texture that should be used for one or more
* //frames. Any strings will be converted to Textures with Texture.fromImage().
* //Instances of PIXI.Texture will be used directly.
* "animFrame1.png",
* //entries can be an object with a 'count' property, telling AnimatedParticle to
* //use that texture for 'count' frames sequentially.
* {
* texture: "animFrame2.png",
* count: 3
* },
* "animFrame3.png"
* ]
* }
*
* @class AnimatedParticle
* @constructor
* @param {Emitter} emitter The emitter that controls this AnimatedParticle.
Expand Down Expand Up @@ -131,6 +158,14 @@
s.destroy.call(this);
};

/**
* Checks over the art that was passed to the Emitter's init() function, to do any special
* modifications to prepare it ahead of time.
* @method parseArt
* @static
* @param {Array} art The array of art data, properly formatted for AnimatedParticle.
* @return {Array} The art, after any needed modifications.
*/
AnimatedParticle.parseArt = function(art)
{
var i, data, output = [], j, textures, tex, outTextures;
Expand Down
3 changes: 2 additions & 1 deletion src/Emitter.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/**
* @module cloudkid
* @module Pixi Particles
* @namespace cloudkid
*/
(function(cloudkid, undefined) {

Expand Down
18 changes: 17 additions & 1 deletion src/Particle.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/**
* @module cloudkid
* @module Pixi Particles
* @namespace cloudkid
*/
(function(cloudkid, undefined) {

Expand Down Expand Up @@ -406,6 +407,8 @@
/**
* Checks over the art that was passed to the Emitter's init() function, to do any special
* modifications to prepare it ahead of time.
* @method parseArt
* @static
* @param {Array} art The array of art data. For Particle, it should be an array of Textures.
* Any strings in the array will be converted to Textures via
* Texture.fromImage().
Expand Down Expand Up @@ -437,6 +440,19 @@

return art;
};

/**
* Parses extra emitter data to ensure it is set up for this particle class.
* Particle does nothing to the extra data.
* @method parseData
* @static
* @param {Object} extraData The extra data from the particle config.
* @return {Object} The parsed extra data.
*/
Particle.parseData = function(extraData)
{
return extraData;
};

cloudkid.Particle = Particle;

Expand Down
6 changes: 4 additions & 2 deletions src/ParticleUtils.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/**
* @module cloudkid
* @module Pixi Particles
* @namespace cloudkid
*/
(function(undefined) {

Expand Down Expand Up @@ -181,7 +182,8 @@
cloudkid.ParticleUtils = ParticleUtils;

/**
* @module global
* @module Pixi Particles
* @namespace window
*/
/**
* Add methods to Array
Expand Down
7 changes: 6 additions & 1 deletion src/PathParticle.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/**
* @module cloudkid
* @module Path Particle
* @namespace cloudkid
*/
(function(cloudkid, undefined) {

Expand Down Expand Up @@ -184,6 +185,8 @@
/**
* Checks over the art that was passed to the Emitter's init() function, to do any special
* modifications to prepare it ahead of time. This just runs Particle.parseArt().
* @method parseArt
* @static
* @param {Array} art The array of art data. For Particle, it should be an array of Textures.
* Any strings in the array will be converted to Textures via
* Texture.fromImage().
Expand All @@ -198,6 +201,8 @@
* Parses extra emitter data to ensure it is set up for this particle class.
* PathParticle checks for the existence of path data, and parses the path data for use
* by particle instances.
* @method parseData
* @static
* @param {Object} extraData The extra data from the particle config.
* @return {Object} The parsed extra data.
*/
Expand Down

0 comments on commit c11628e

Please sign in to comment.