mirror of
https://github.com/photonstorm/phaser
synced 2025-02-17 06:28:30 +00:00
Merge branch 'master' of https://github.com/photonstorm/phaser
This commit is contained in:
commit
633098cf88
597 changed files with 1323713 additions and 1287423 deletions
50
v2-community/.jshintrc
Normal file
50
v2-community/.jshintrc
Normal file
|
@ -0,0 +1,50 @@
|
|||
{
|
||||
"globals" : { "Phaser": false, "PIXI": false, "p2": false, "CocoonJS": false, "process": false, "JSON": false },
|
||||
|
||||
// Ignore Environment Globals
|
||||
"browser" : true, // Standard browser globals e.g. `window`, `document`.
|
||||
|
||||
// Development
|
||||
"devel" : true, // Allow developments statements e.g. `console.log();`.
|
||||
|
||||
// ECMAScript Support
|
||||
"es3" : true, // Support legacy browser and javascript environments.
|
||||
"esnext" : false, // This option tells JSHint that your code uses ECMAScript 6 specific syntax.
|
||||
"strict" : false, // Require `use strict` pragma in every file.
|
||||
"globalstrict": false, // Allow global "use strict" (also enables 'strict').
|
||||
|
||||
// Functionality
|
||||
"bitwise" : false, // Prohibit bitwise operators (&, |, ^, etc.).
|
||||
"boss" : true, // Tolerate assignments inside if, for & while. Usually conditions & loops are for comparison, not assignments.
|
||||
"camelcase" : true, // Force all variable names to use either camelCase style or UPPER_CASE with underscores.
|
||||
"curly" : true, // Require {} for every new block or scope.
|
||||
"eqeqeq" : true, // Require triple equals i.e. `===`.
|
||||
"eqnull" : true, // Tolerate use of `== null`.
|
||||
"evil" : false, // Tolerate use of `eval`.
|
||||
"expr" : false, // Tolerate `ExpressionStatement` as Programs.
|
||||
"forin" : false, // Tolerate `for in` loops without `hasOwnPrototype`.
|
||||
"freeze" : true, // Prohibits overwriting prototypes of native objects such as Array and Date.
|
||||
"funcscope" : true, // This option suppresses warnings about declaring variables inside of control structures while accessing them later from the outside.
|
||||
"immed" : true, // Require immediate invocations to be wrapped in parens e.g. `( function(){}() );`
|
||||
"latedef" : true, // Prohibit variable use before definition.
|
||||
"laxbreak" : false, // Tolerate unsafe line breaks e.g. `return [\n] x` without semicolons.
|
||||
"laxcomma" : false, // This option suppresses warnings about comma-first coding style.
|
||||
"loopfunc" : true, // Allow functions to be defined within loops.
|
||||
"noarg" : true, // Prohibit use of `arguments.caller` and `arguments.callee`.
|
||||
"notypeof" : false, // This option suppresses warnings about invalid typeof operator values.
|
||||
"shadow" : true, // Allows re-define variables later in code e.g. `var x=1; x=2;`.
|
||||
"smarttabs" : false, // This option suppresses warnings about mixed tabs and spaces when the latter are used for alignmnent only.
|
||||
"supernew" : false, // Tolerate `new function () { ... };` and `new Object;`.
|
||||
"undef" : true, // Require all non-global variables be declared before they are used.
|
||||
"unused" : true, // This option warns when you define and never use your variables.
|
||||
|
||||
// Styling
|
||||
"indent" : 4, // Specify indentation spacing
|
||||
"newcap" : true, // Require capitalization of all constructor functions e.g. `new F()`.
|
||||
"noempty" : true, // Prohibit use of empty blocks.
|
||||
"nonew" : true, // Prohibit use of constructors for side-effects.
|
||||
"plusplus" : false, // Prohibit use of `++` & `--`.
|
||||
"quotmark" : false, // This option enforces the consistency of quotation marks used throughout your code.
|
||||
"sub" : true, // Tolerate all forms of subscript notation besides dot notation e.g. `dict['key']` instead of `dict.key`.
|
||||
"trailing" : true // Prohibit trailing whitespaces.
|
||||
}
|
|
@ -1,5 +1,21 @@
|
|||
# Change Log
|
||||
|
||||
## Version 2.7.2 - 6th December 2016
|
||||
|
||||
### New Features
|
||||
|
||||
* Added feature: set character limit with suffix
|
||||
|
||||
### Updates
|
||||
|
||||
* Clarification of fixedToCamera semantics
|
||||
* change Emitter.gravity from number to Phaser.Point
|
||||
* Fixed issue causing tsc to crap out under certain circumstances
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* removeTextureAtlas now deletes the correct cache object.
|
||||
|
||||
## Version 2.7.1 - 28th November 2016
|
||||
|
||||
### Updates
|
||||
|
|
|
@ -266,6 +266,18 @@ Should you wish to build Phaser from source you can take advantage of the provid
|
|||
|
||||
Run `grunt` to perform a default build to the `dist` folder.
|
||||
|
||||
### Packaging a new release
|
||||
|
||||
Releases of new versions of Phaser CE are under the communities control. If you feel there are sufficient fixes, or important ones that warrant a new version release, then please do the following:
|
||||
|
||||
1. Make sure the version number is increased, in line with semver policies, in the following files: `package.json` and `src/Phaser.js`
|
||||
|
||||
2. Make sure that you have added details of the new version to the `README.md` and `CHANGELOG.md`. This should include a summary of changes made in the version. You can usually obtain this from the commit / PR history. It's nice to credit who made the changes by linking to their GitHub user ID, but isn't a requirement.
|
||||
|
||||
3. From the root of the `v2-community` folder, run `grunt jshint` and make sure there are no jshint errors. If there are, please fix them, or request that the original author of the code does so.
|
||||
|
||||
4. Once jshint passes run `grunt release`, sit back, and wait. It will build all of the versions of Phaser required, update the doc files, TypeScript defs and lots more. When finished, commit all of the new files and make sure to include a clear message in your commit saying you want this release pushed to npm. Be sure to tag me when doing this, i.e. 'Phaser CE Version 2.X.X. Please publish to npm @photonstorm' - I'll see it, and then publish as soon as I can (often the same day).
|
||||
|
||||
![Made With Phaser](http://phaser.io/images/github/div-made-with.png "Made With Phaser")
|
||||
<a name="games"></a>
|
||||
|
||||
|
@ -314,6 +326,29 @@ If you code with [TypeScript](http://www.typescriptlang.org/) there are comprehe
|
|||
![Change Log](http://phaser.io/images/github/div-change-log.png "Change Log")
|
||||
<a name="change-log"></a>
|
||||
|
||||
## Version 2.7.3 - In development
|
||||
|
||||
* Replaced missing jshintrc file (#2912)
|
||||
* Added tempPoint argument / undefined block to Graphics.containsPoint
|
||||
* Fixed Text.setCharacterLimit conditional check
|
||||
* Added resolution argument to LoaderParser.jsonBitmapFont
|
||||
|
||||
## Version 2.7.2 - 6th December 2016
|
||||
|
||||
### New Features
|
||||
|
||||
* Added feature: set character limit with suffix
|
||||
|
||||
### Updates
|
||||
|
||||
* Clarification of fixedToCamera semantics
|
||||
* change Emitter.gravity from number to Phaser.Point
|
||||
* Fixed issue causing tsc to crap out under certain circumstances
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* removeTextureAtlas now deletes the correct cache object.
|
||||
|
||||
## Version 2.7.1 - 28th November 2016
|
||||
|
||||
### Updates
|
||||
|
@ -416,11 +451,11 @@ The [Contributors Guide][contribute] contains full details on how to help with P
|
|||
|
||||
- Found a bug? Report it on [GitHub Issues][issues] and include a code sample.
|
||||
|
||||
- Pull Requests should only be made against the `dev` branch. *Never* against `master`.
|
||||
- Pull Requests should only be made against the `v2-community` folder version of Phaser, never `v2`.
|
||||
|
||||
- Before submitting a Pull Request run your code through [JSHint](http://www.jshint.com/) using our [config](https://github.com/photonstorm/phaser/blob/master/.jshintrc).
|
||||
- Before submitting a Pull Request run your code through [JSHint](http://www.jshint.com/) using our [config](https://github.com/photonstorm/phaser/blob/master/v2-community/.jshintrc).
|
||||
|
||||
- Before contributing read the [code of conduct](https://github.com/photonstorm/phaser/blob/master/CODE_OF_CONDUCT.md).
|
||||
- Before contributing read the [code of conduct](https://github.com/photonstorm/phaser/blob/master/v2-community/CODE_OF_CONDUCT.md).
|
||||
|
||||
Written something cool in Phaser? Please tell us about it in the [forum][forum], or email support@phaser.io
|
||||
|
||||
|
|
2
v2-community/build/creature.min.js
vendored
2
v2-community/build/creature.min.js
vendored
File diff suppressed because one or more lines are too long
2
v2-community/build/custom/p2.min.js
vendored
2
v2-community/build/custom/p2.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -7,7 +7,7 @@
|
|||
*
|
||||
* Phaser - http://phaser.io
|
||||
*
|
||||
* v2.7.1 "2016-11-28" - Built: Mon Nov 28 2016 18:47:22
|
||||
* v2.7.2 "2016-12-06" - Built: Tue Dec 06 2016 23:48:20
|
||||
*
|
||||
* By Richard Davey http://www.photonstorm.com @photonstorm
|
||||
*
|
||||
|
@ -69,7 +69,7 @@ var PIXI = PIXI || {};
|
|||
*
|
||||
* It is used internally by the likes of PIXI.Sprite.
|
||||
*
|
||||
* @class PIXI.DisplayObject
|
||||
* @class DisplayObject
|
||||
* @constructor
|
||||
*/
|
||||
PIXI.DisplayObject = function () {
|
||||
|
@ -6896,7 +6896,6 @@ PIXI.CanvasRenderer.prototype.mapBlendModes = function () {
|
|||
* A texture stores the information that represents an image. All textures have a base texture.
|
||||
*
|
||||
* @class BaseTexture
|
||||
* @uses EventTarget
|
||||
* @constructor
|
||||
* @param source {String|Canvas} the source object (image or canvas)
|
||||
* @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values
|
||||
|
@ -7164,7 +7163,6 @@ PIXI.TextureSilentFail = false;
|
|||
* to the display list directly. Instead use it as the texture for a PIXI.Sprite. If no frame is provided then the whole image is used.
|
||||
*
|
||||
* @class Texture
|
||||
* @uses EventTarget
|
||||
* @constructor
|
||||
* @param baseTexture {BaseTexture} The base texture source to create the texture from
|
||||
* @param frame {Rectangle} The rectangle frame of the texture to show
|
||||
|
@ -7506,7 +7504,7 @@ var Phaser = Phaser || { // jshint ignore:line
|
|||
* @constant
|
||||
* @type {string}
|
||||
*/
|
||||
VERSION: '2.7.1',
|
||||
VERSION: '2.7.2',
|
||||
|
||||
/**
|
||||
* An array of Phaser game instances.
|
||||
|
@ -17320,7 +17318,7 @@ Phaser.Group.prototype.add = function (child, silent, index) {
|
|||
*/
|
||||
Phaser.Group.prototype.addAt = function (child, index, silent) {
|
||||
|
||||
this.add(child, silent, index);
|
||||
return this.add(child, silent, index);
|
||||
|
||||
};
|
||||
|
||||
|
@ -31783,7 +31781,8 @@ Phaser.Component.FixedToCamera.prototype = {
|
|||
_fixedToCamera: false,
|
||||
|
||||
/**
|
||||
* A Game Object that is "fixed" to the camera uses its x/y coordinates as offsets from the top left of the camera during rendering.
|
||||
* A Game Object that is "fixed" to the camera is rendered at a given x/y offsets from the top left of the camera. The offsets
|
||||
* are stored in the `cameraOffset` property, which is initialized with the current object coordinates.
|
||||
*
|
||||
* The values are adjusted at the rendering stage, overriding the Game Objects actual world position.
|
||||
*
|
||||
|
@ -31791,8 +31790,6 @@ Phaser.Component.FixedToCamera.prototype = {
|
|||
* the camera is viewing. This is useful if for example this Game Object is a UI item that you wish to be visible at all times
|
||||
* regardless where in the world the camera is.
|
||||
*
|
||||
* The offsets are stored in the `cameraOffset` property.
|
||||
*
|
||||
* Note that the `cameraOffset` values are in addition to any parent of this Game Object on the display list.
|
||||
*
|
||||
* Be careful not to set `fixedToCamera` on Game Objects which are in Groups that already have `fixedToCamera` enabled on them.
|
||||
|
@ -33231,7 +33228,7 @@ Phaser.GameObjectFactory.prototype = {
|
|||
* @param {number} [y=0] - The y coordinate of the creature. The coordinate is relative to any parent container this creature may be in.
|
||||
* @param {string|PIXI.Texture} [key] - The image used as a texture by this creature object during rendering. If a string Phaser will get for an entry in the Image Cache. Or it can be an instance of a PIXI.Texture.
|
||||
* @param {Phaser.Group} [group] - Optional Group to add the object to. If not specified it will be added to the World group.
|
||||
* @returns {Phaser.Creature} The newly created Sprite object.
|
||||
* @returns {Phaser.Creature} The newly created Creature object.
|
||||
*/
|
||||
creature: function (x, y, key, mesh, group) {
|
||||
|
||||
|
@ -41646,6 +41643,18 @@ Phaser.Text = function (game, x, y, text, style) {
|
|||
*/
|
||||
this.splitRegExp = /(?:\r\n|\r|\n)/;
|
||||
|
||||
|
||||
/** The maximum number of characters that can be set.
|
||||
* @property {number} characterLimitSize
|
||||
*/
|
||||
this.characterLimitSize = -1;
|
||||
|
||||
/** The suffix that is applied to truncated text that is longer than the
|
||||
* characterLimitSize.
|
||||
* @property {string} characterLimitSuffix
|
||||
*/
|
||||
this.characterLimitSuffix = '';
|
||||
|
||||
/**
|
||||
* @property {number} _res - Internal canvas resolution var.
|
||||
* @private
|
||||
|
@ -41882,6 +41891,10 @@ Phaser.Text.prototype.updateText = function () {
|
|||
|
||||
var outputText = this.text;
|
||||
|
||||
if (this.characterLimitSize > -1 && this.characterLimitSize < outputText.length) {
|
||||
outputText = this.text.substring(0, this.characterLimitSize) + this.characterLimitSuffix;
|
||||
}
|
||||
|
||||
if (this.style.wordWrap)
|
||||
{
|
||||
outputText = this.runWordWrap(this.text);
|
||||
|
@ -43163,6 +43176,22 @@ Phaser.Text.prototype.getBounds = function (matrix) {
|
|||
|
||||
};
|
||||
|
||||
/**
|
||||
* Sets the character limit of the text, with a suffix.
|
||||
* If the text is longer than this limit, it is truncated and the suffix is appended.
|
||||
*
|
||||
* @method Phaser.Text#setCharacterLimit
|
||||
* @param {number} [characterLimit] - The x coordinate of the Text Bounds region.
|
||||
* @param {string} [suffix] - The suffix to append to the truncated text.
|
||||
*/
|
||||
Phaser.Text.prototype.setCharacterLimit = function (characterLimit, suffix) {
|
||||
|
||||
this.characterLimitSuffix = suffix == undefined ? '' : suffix;
|
||||
this.characterLimitSize = characterLimit;
|
||||
|
||||
this.updateText();
|
||||
}
|
||||
|
||||
/**
|
||||
* The text to be displayed by this Text object.
|
||||
* Use a \n to insert a carriage return and split the text.
|
||||
|
@ -55161,6 +55190,9 @@ Phaser.AnimationManager.prototype = {
|
|||
*
|
||||
* If the requested animation is already playing this request will be ignored.
|
||||
* If you need to reset an already running animation do so directly on the Animation object itself.
|
||||
*
|
||||
* If you need to jump to a specific frame of this animation, then call `play` and immediately after it,
|
||||
* set the frame you require (i.e. `animation.play(); animation.frame = 4`).
|
||||
*
|
||||
* @method Phaser.AnimationManager#play
|
||||
* @param {string} name - The name of the animation to be played, e.g. "fire", "walk", "jump".
|
||||
|
@ -55638,6 +55670,9 @@ Phaser.Animation.prototype = {
|
|||
|
||||
/**
|
||||
* Plays this animation.
|
||||
*
|
||||
* If you need to jump to a specific frame of this animation, then call `play` and immediately after it,
|
||||
* set the frame you require (i.e. `animation.play(); animation.frame = 4`).
|
||||
*
|
||||
* @method Phaser.Animation#play
|
||||
* @param {number} [frameRate=null] - The framerate to play the animation at. The speed is given in frames per second. If not provided the previously set frameRate of the Animation is used.
|
||||
|
@ -59214,7 +59249,7 @@ Phaser.Cache.prototype = {
|
|||
*/
|
||||
removeTextureAtlas: function (key) {
|
||||
|
||||
delete this._cache.atlas[key];
|
||||
delete this._cache.image[key];
|
||||
|
||||
},
|
||||
|
||||
|
@ -61060,14 +61095,14 @@ Phaser.Loader.prototype = {
|
|||
},
|
||||
|
||||
/**
|
||||
* Add a synchronization point to the assets/files added within the supplied callback.
|
||||
* Add a synchronization point to the assets / files added within the supplied callback.
|
||||
*
|
||||
* A synchronization point denotes that an asset _must_ be completely loaded before
|
||||
* subsequent assets can be loaded. An asset marked as a sync-point does not need to wait
|
||||
* for previous assets to load (unless they are sync-points). Resources, such as packs, may still
|
||||
* be downloaded around sync-points, as long as they do not finalize loading.
|
||||
*
|
||||
* @method Phaser.Loader#withSyncPoints
|
||||
* @method Phaser.Loader#withSyncPoint
|
||||
* @param {function} callback - The callback is invoked and is supplied with a single argument: the loader.
|
||||
* @param {object} [callbackContext=(loader)] - Context for the callback.
|
||||
* @return {Phaser.Loader} This Loader instance.
|
||||
|
@ -69221,7 +69256,7 @@ Phaser.ArrayUtils = {
|
|||
* Will return null if there are no array items that fall within the specified range
|
||||
* or if there is no item for the randomly chosen index.
|
||||
*
|
||||
* @method
|
||||
* @method Phaser.ArrayUtils.getRandomItem
|
||||
* @param {any[]} objects - An array of objects.
|
||||
* @param {integer} startIndex - Optional offset off the front of the array. Default value is 0, or the beginning of the array.
|
||||
* @param {integer} length - Optional restriction on the number of values you want to randomly select from.
|
||||
|
@ -69245,7 +69280,7 @@ Phaser.ArrayUtils = {
|
|||
* Will return null if there are no array items that fall within the specified range
|
||||
* or if there is no item for the randomly chosen index.
|
||||
*
|
||||
* @method
|
||||
* @method Phaser.ArrayUtils.removeRandomItem
|
||||
* @param {any[]} objects - An array of objects.
|
||||
* @param {integer} startIndex - Optional offset off the front of the array. Default value is 0, or the beginning of the array.
|
||||
* @param {integer} length - Optional restriction on the number of values you want to randomly select from.
|
||||
|
@ -69276,7 +69311,7 @@ Phaser.ArrayUtils = {
|
|||
/**
|
||||
* A standard Fisher-Yates Array shuffle implementation which modifies the array in place.
|
||||
*
|
||||
* @method
|
||||
* @method Phaser.ArrayUtils.shuffle
|
||||
* @param {any[]} array - The array to shuffle.
|
||||
* @return {any[]} The original array, now shuffled.
|
||||
*/
|
||||
|
@ -69297,7 +69332,7 @@ Phaser.ArrayUtils = {
|
|||
/**
|
||||
* Transposes the elements of the given matrix (array of arrays).
|
||||
*
|
||||
* @method
|
||||
* @method Phaser.ArrayUtils.transposeMatrix
|
||||
* @param {Array<any[]>} array - The matrix to transpose.
|
||||
* @return {Array<any[]>} A new transposed matrix
|
||||
*/
|
||||
|
@ -69327,7 +69362,7 @@ Phaser.ArrayUtils = {
|
|||
*
|
||||
* Based on the routine from {@link http://jsfiddle.net/MrPolywhirl/NH42z/}.
|
||||
*
|
||||
* @method
|
||||
* @method Phaser.ArrayUtils.rotateMatrix
|
||||
* @param {Array<any[]>} matrix - The array to rotate; this matrix _may_ be altered.
|
||||
* @param {number|string} direction - The amount to rotate: the rotation in degrees (90, -90, 270, -270, 180) or a string command ('rotateLeft', 'rotateRight' or 'rotate180').
|
||||
* @return {Array<any[]>} The rotated matrix. The source matrix should be discarded for the returned matrix.
|
||||
|
@ -69367,7 +69402,7 @@ Phaser.ArrayUtils = {
|
|||
* Snaps a value to the nearest value in an array.
|
||||
* The result will always be in the range `[first_value, last_value]`.
|
||||
*
|
||||
* @method
|
||||
* @method Phaser.ArrayUtils.findClosest
|
||||
* @param {number} value - The search value
|
||||
* @param {number[]} arr - The input array which _must_ be sorted.
|
||||
* @return {number} The nearest value found.
|
||||
|
@ -69466,7 +69501,7 @@ Phaser.ArrayUtils = {
|
|||
* Create an array representing the inclusive range of numbers (usually integers) in `[start, end]`.
|
||||
* This is equivalent to `numberArrayStep(start, end, 1)`.
|
||||
*
|
||||
* @method Phaser.ArrayUtils#numberArray
|
||||
* @method Phaser.ArrayUtils.numberArray
|
||||
* @param {number} start - The minimum value the array starts with.
|
||||
* @param {number} end - The maximum value the array contains.
|
||||
* @return {number[]} The array of number values.
|
||||
|
@ -69493,7 +69528,7 @@ Phaser.ArrayUtils = {
|
|||
* Certain values for `start` and `end` (eg. NaN/undefined/null) are currently coerced to 0;
|
||||
* for forward compatibility make sure to pass in actual numbers.
|
||||
*
|
||||
* @method Phaser.ArrayUtils#numberArrayStep
|
||||
* @method Phaser.ArrayUtils.numberArrayStep
|
||||
* @param {number} start - The start of the range.
|
||||
* @param {number} [end] - The end of the range.
|
||||
* @param {number} [step=1] - The value to increment or decrement by.
|
||||
|
@ -81412,10 +81447,10 @@ Phaser.Particles.Arcade.Emitter = function (game, x, y, maxParticles) {
|
|||
this.alphaData = null;
|
||||
|
||||
/**
|
||||
* @property {number} gravity - Sets the `body.gravity.y` of each particle sprite to this value on launch.
|
||||
* @property {Phaser.Point} gravity - Sets the `body.gravity` of each particle sprite to this on launch.
|
||||
* @default
|
||||
*/
|
||||
this.gravity = 100;
|
||||
this.gravity = new Phaser.Point(0, 100);
|
||||
|
||||
/**
|
||||
* @property {any} particleClass - For emitting your own particle class types. They must extend Phaser.Particle.
|
||||
|
@ -81773,6 +81808,7 @@ Phaser.Particles.Arcade.Emitter.prototype.explode = function (lifespan, quantity
|
|||
*/
|
||||
Phaser.Particles.Arcade.Emitter.prototype.flow = function (lifespan, frequency, quantity, total, immediate) {
|
||||
|
||||
if (frequency === undefined || frequency === null) { frequency = 250; }
|
||||
if (quantity === undefined || quantity === 0) { quantity = 1; }
|
||||
if (total === undefined) { total = -1; }
|
||||
if (immediate === undefined) { immediate = true; }
|
||||
|
@ -81972,7 +82008,7 @@ Phaser.Particles.Arcade.Emitter.prototype.emitParticle = function (x, y, key, fr
|
|||
body.velocity.y = rnd.between(this.minParticleSpeed.y, this.maxParticleSpeed.y);
|
||||
body.angularVelocity = rnd.between(this.minRotation, this.maxRotation);
|
||||
|
||||
body.gravity.y = this.gravity;
|
||||
body.gravity = this.gravity;
|
||||
body.angularDrag = this.angularDrag;
|
||||
|
||||
particle.onEmit();
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -7,7 +7,7 @@
|
|||
*
|
||||
* Phaser - http://phaser.io
|
||||
*
|
||||
* v2.7.1 "2016-11-28" - Built: Mon Nov 28 2016 18:47:30
|
||||
* v2.7.2 "2016-12-06" - Built: Tue Dec 06 2016 23:48:29
|
||||
*
|
||||
* By Richard Davey http://www.photonstorm.com @photonstorm
|
||||
*
|
||||
|
@ -69,7 +69,7 @@ var PIXI = PIXI || {};
|
|||
*
|
||||
* It is used internally by the likes of PIXI.Sprite.
|
||||
*
|
||||
* @class PIXI.DisplayObject
|
||||
* @class DisplayObject
|
||||
* @constructor
|
||||
*/
|
||||
PIXI.DisplayObject = function () {
|
||||
|
@ -6896,7 +6896,6 @@ PIXI.CanvasRenderer.prototype.mapBlendModes = function () {
|
|||
* A texture stores the information that represents an image. All textures have a base texture.
|
||||
*
|
||||
* @class BaseTexture
|
||||
* @uses EventTarget
|
||||
* @constructor
|
||||
* @param source {String|Canvas} the source object (image or canvas)
|
||||
* @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values
|
||||
|
@ -7164,7 +7163,6 @@ PIXI.TextureSilentFail = false;
|
|||
* to the display list directly. Instead use it as the texture for a PIXI.Sprite. If no frame is provided then the whole image is used.
|
||||
*
|
||||
* @class Texture
|
||||
* @uses EventTarget
|
||||
* @constructor
|
||||
* @param baseTexture {BaseTexture} The base texture source to create the texture from
|
||||
* @param frame {Rectangle} The rectangle frame of the texture to show
|
||||
|
@ -7506,7 +7504,7 @@ var Phaser = Phaser || { // jshint ignore:line
|
|||
* @constant
|
||||
* @type {string}
|
||||
*/
|
||||
VERSION: '2.7.1',
|
||||
VERSION: '2.7.2',
|
||||
|
||||
/**
|
||||
* An array of Phaser game instances.
|
||||
|
@ -17320,7 +17318,7 @@ Phaser.Group.prototype.add = function (child, silent, index) {
|
|||
*/
|
||||
Phaser.Group.prototype.addAt = function (child, index, silent) {
|
||||
|
||||
this.add(child, silent, index);
|
||||
return this.add(child, silent, index);
|
||||
|
||||
};
|
||||
|
||||
|
@ -29364,7 +29362,8 @@ Phaser.Component.FixedToCamera.prototype = {
|
|||
_fixedToCamera: false,
|
||||
|
||||
/**
|
||||
* A Game Object that is "fixed" to the camera uses its x/y coordinates as offsets from the top left of the camera during rendering.
|
||||
* A Game Object that is "fixed" to the camera is rendered at a given x/y offsets from the top left of the camera. The offsets
|
||||
* are stored in the `cameraOffset` property, which is initialized with the current object coordinates.
|
||||
*
|
||||
* The values are adjusted at the rendering stage, overriding the Game Objects actual world position.
|
||||
*
|
||||
|
@ -29372,8 +29371,6 @@ Phaser.Component.FixedToCamera.prototype = {
|
|||
* the camera is viewing. This is useful if for example this Game Object is a UI item that you wish to be visible at all times
|
||||
* regardless where in the world the camera is.
|
||||
*
|
||||
* The offsets are stored in the `cameraOffset` property.
|
||||
*
|
||||
* Note that the `cameraOffset` values are in addition to any parent of this Game Object on the display list.
|
||||
*
|
||||
* Be careful not to set `fixedToCamera` on Game Objects which are in Groups that already have `fixedToCamera` enabled on them.
|
||||
|
@ -30812,7 +30809,7 @@ Phaser.GameObjectFactory.prototype = {
|
|||
* @param {number} [y=0] - The y coordinate of the creature. The coordinate is relative to any parent container this creature may be in.
|
||||
* @param {string|PIXI.Texture} [key] - The image used as a texture by this creature object during rendering. If a string Phaser will get for an entry in the Image Cache. Or it can be an instance of a PIXI.Texture.
|
||||
* @param {Phaser.Group} [group] - Optional Group to add the object to. If not specified it will be added to the World group.
|
||||
* @returns {Phaser.Creature} The newly created Sprite object.
|
||||
* @returns {Phaser.Creature} The newly created Creature object.
|
||||
*/
|
||||
creature: function (x, y, key, mesh, group) {
|
||||
|
||||
|
@ -38602,6 +38599,9 @@ Phaser.AnimationManager.prototype = {
|
|||
*
|
||||
* If the requested animation is already playing this request will be ignored.
|
||||
* If you need to reset an already running animation do so directly on the Animation object itself.
|
||||
*
|
||||
* If you need to jump to a specific frame of this animation, then call `play` and immediately after it,
|
||||
* set the frame you require (i.e. `animation.play(); animation.frame = 4`).
|
||||
*
|
||||
* @method Phaser.AnimationManager#play
|
||||
* @param {string} name - The name of the animation to be played, e.g. "fire", "walk", "jump".
|
||||
|
@ -39079,6 +39079,9 @@ Phaser.Animation.prototype = {
|
|||
|
||||
/**
|
||||
* Plays this animation.
|
||||
*
|
||||
* If you need to jump to a specific frame of this animation, then call `play` and immediately after it,
|
||||
* set the frame you require (i.e. `animation.play(); animation.frame = 4`).
|
||||
*
|
||||
* @method Phaser.Animation#play
|
||||
* @param {number} [frameRate=null] - The framerate to play the animation at. The speed is given in frames per second. If not provided the previously set frameRate of the Animation is used.
|
||||
|
@ -42655,7 +42658,7 @@ Phaser.Cache.prototype = {
|
|||
*/
|
||||
removeTextureAtlas: function (key) {
|
||||
|
||||
delete this._cache.atlas[key];
|
||||
delete this._cache.image[key];
|
||||
|
||||
},
|
||||
|
||||
|
@ -44501,14 +44504,14 @@ Phaser.Loader.prototype = {
|
|||
},
|
||||
|
||||
/**
|
||||
* Add a synchronization point to the assets/files added within the supplied callback.
|
||||
* Add a synchronization point to the assets / files added within the supplied callback.
|
||||
*
|
||||
* A synchronization point denotes that an asset _must_ be completely loaded before
|
||||
* subsequent assets can be loaded. An asset marked as a sync-point does not need to wait
|
||||
* for previous assets to load (unless they are sync-points). Resources, such as packs, may still
|
||||
* be downloaded around sync-points, as long as they do not finalize loading.
|
||||
*
|
||||
* @method Phaser.Loader#withSyncPoints
|
||||
* @method Phaser.Loader#withSyncPoint
|
||||
* @param {function} callback - The callback is invoked and is supplied with a single argument: the loader.
|
||||
* @param {object} [callbackContext=(loader)] - Context for the callback.
|
||||
* @return {Phaser.Loader} This Loader instance.
|
||||
|
@ -49665,7 +49668,7 @@ Phaser.ArrayUtils = {
|
|||
* Will return null if there are no array items that fall within the specified range
|
||||
* or if there is no item for the randomly chosen index.
|
||||
*
|
||||
* @method
|
||||
* @method Phaser.ArrayUtils.getRandomItem
|
||||
* @param {any[]} objects - An array of objects.
|
||||
* @param {integer} startIndex - Optional offset off the front of the array. Default value is 0, or the beginning of the array.
|
||||
* @param {integer} length - Optional restriction on the number of values you want to randomly select from.
|
||||
|
@ -49689,7 +49692,7 @@ Phaser.ArrayUtils = {
|
|||
* Will return null if there are no array items that fall within the specified range
|
||||
* or if there is no item for the randomly chosen index.
|
||||
*
|
||||
* @method
|
||||
* @method Phaser.ArrayUtils.removeRandomItem
|
||||
* @param {any[]} objects - An array of objects.
|
||||
* @param {integer} startIndex - Optional offset off the front of the array. Default value is 0, or the beginning of the array.
|
||||
* @param {integer} length - Optional restriction on the number of values you want to randomly select from.
|
||||
|
@ -49720,7 +49723,7 @@ Phaser.ArrayUtils = {
|
|||
/**
|
||||
* A standard Fisher-Yates Array shuffle implementation which modifies the array in place.
|
||||
*
|
||||
* @method
|
||||
* @method Phaser.ArrayUtils.shuffle
|
||||
* @param {any[]} array - The array to shuffle.
|
||||
* @return {any[]} The original array, now shuffled.
|
||||
*/
|
||||
|
@ -49741,7 +49744,7 @@ Phaser.ArrayUtils = {
|
|||
/**
|
||||
* Transposes the elements of the given matrix (array of arrays).
|
||||
*
|
||||
* @method
|
||||
* @method Phaser.ArrayUtils.transposeMatrix
|
||||
* @param {Array<any[]>} array - The matrix to transpose.
|
||||
* @return {Array<any[]>} A new transposed matrix
|
||||
*/
|
||||
|
@ -49771,7 +49774,7 @@ Phaser.ArrayUtils = {
|
|||
*
|
||||
* Based on the routine from {@link http://jsfiddle.net/MrPolywhirl/NH42z/}.
|
||||
*
|
||||
* @method
|
||||
* @method Phaser.ArrayUtils.rotateMatrix
|
||||
* @param {Array<any[]>} matrix - The array to rotate; this matrix _may_ be altered.
|
||||
* @param {number|string} direction - The amount to rotate: the rotation in degrees (90, -90, 270, -270, 180) or a string command ('rotateLeft', 'rotateRight' or 'rotate180').
|
||||
* @return {Array<any[]>} The rotated matrix. The source matrix should be discarded for the returned matrix.
|
||||
|
@ -49811,7 +49814,7 @@ Phaser.ArrayUtils = {
|
|||
* Snaps a value to the nearest value in an array.
|
||||
* The result will always be in the range `[first_value, last_value]`.
|
||||
*
|
||||
* @method
|
||||
* @method Phaser.ArrayUtils.findClosest
|
||||
* @param {number} value - The search value
|
||||
* @param {number[]} arr - The input array which _must_ be sorted.
|
||||
* @return {number} The nearest value found.
|
||||
|
@ -49910,7 +49913,7 @@ Phaser.ArrayUtils = {
|
|||
* Create an array representing the inclusive range of numbers (usually integers) in `[start, end]`.
|
||||
* This is equivalent to `numberArrayStep(start, end, 1)`.
|
||||
*
|
||||
* @method Phaser.ArrayUtils#numberArray
|
||||
* @method Phaser.ArrayUtils.numberArray
|
||||
* @param {number} start - The minimum value the array starts with.
|
||||
* @param {number} end - The maximum value the array contains.
|
||||
* @return {number[]} The array of number values.
|
||||
|
@ -49937,7 +49940,7 @@ Phaser.ArrayUtils = {
|
|||
* Certain values for `start` and `end` (eg. NaN/undefined/null) are currently coerced to 0;
|
||||
* for forward compatibility make sure to pass in actual numbers.
|
||||
*
|
||||
* @method Phaser.ArrayUtils#numberArrayStep
|
||||
* @method Phaser.ArrayUtils.numberArrayStep
|
||||
* @param {number} start - The start of the range.
|
||||
* @param {number} [end] - The end of the range.
|
||||
* @param {number} [step=1] - The value to increment or decrement by.
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -7,7 +7,7 @@
|
|||
*
|
||||
* Phaser - http://phaser.io
|
||||
*
|
||||
* v2.7.1 "2016-11-28" - Built: Mon Nov 28 2016 18:47:27
|
||||
* v2.7.2 "2016-12-06" - Built: Tue Dec 06 2016 23:48:25
|
||||
*
|
||||
* By Richard Davey http://www.photonstorm.com @photonstorm
|
||||
*
|
||||
|
@ -69,7 +69,7 @@ var PIXI = PIXI || {};
|
|||
*
|
||||
* It is used internally by the likes of PIXI.Sprite.
|
||||
*
|
||||
* @class PIXI.DisplayObject
|
||||
* @class DisplayObject
|
||||
* @constructor
|
||||
*/
|
||||
PIXI.DisplayObject = function () {
|
||||
|
@ -6896,7 +6896,6 @@ PIXI.CanvasRenderer.prototype.mapBlendModes = function () {
|
|||
* A texture stores the information that represents an image. All textures have a base texture.
|
||||
*
|
||||
* @class BaseTexture
|
||||
* @uses EventTarget
|
||||
* @constructor
|
||||
* @param source {String|Canvas} the source object (image or canvas)
|
||||
* @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values
|
||||
|
@ -7164,7 +7163,6 @@ PIXI.TextureSilentFail = false;
|
|||
* to the display list directly. Instead use it as the texture for a PIXI.Sprite. If no frame is provided then the whole image is used.
|
||||
*
|
||||
* @class Texture
|
||||
* @uses EventTarget
|
||||
* @constructor
|
||||
* @param baseTexture {BaseTexture} The base texture source to create the texture from
|
||||
* @param frame {Rectangle} The rectangle frame of the texture to show
|
||||
|
@ -7506,7 +7504,7 @@ var Phaser = Phaser || { // jshint ignore:line
|
|||
* @constant
|
||||
* @type {string}
|
||||
*/
|
||||
VERSION: '2.7.1',
|
||||
VERSION: '2.7.2',
|
||||
|
||||
/**
|
||||
* An array of Phaser game instances.
|
||||
|
@ -17320,7 +17318,7 @@ Phaser.Group.prototype.add = function (child, silent, index) {
|
|||
*/
|
||||
Phaser.Group.prototype.addAt = function (child, index, silent) {
|
||||
|
||||
this.add(child, silent, index);
|
||||
return this.add(child, silent, index);
|
||||
|
||||
};
|
||||
|
||||
|
@ -31783,7 +31781,8 @@ Phaser.Component.FixedToCamera.prototype = {
|
|||
_fixedToCamera: false,
|
||||
|
||||
/**
|
||||
* A Game Object that is "fixed" to the camera uses its x/y coordinates as offsets from the top left of the camera during rendering.
|
||||
* A Game Object that is "fixed" to the camera is rendered at a given x/y offsets from the top left of the camera. The offsets
|
||||
* are stored in the `cameraOffset` property, which is initialized with the current object coordinates.
|
||||
*
|
||||
* The values are adjusted at the rendering stage, overriding the Game Objects actual world position.
|
||||
*
|
||||
|
@ -31791,8 +31790,6 @@ Phaser.Component.FixedToCamera.prototype = {
|
|||
* the camera is viewing. This is useful if for example this Game Object is a UI item that you wish to be visible at all times
|
||||
* regardless where in the world the camera is.
|
||||
*
|
||||
* The offsets are stored in the `cameraOffset` property.
|
||||
*
|
||||
* Note that the `cameraOffset` values are in addition to any parent of this Game Object on the display list.
|
||||
*
|
||||
* Be careful not to set `fixedToCamera` on Game Objects which are in Groups that already have `fixedToCamera` enabled on them.
|
||||
|
@ -33231,7 +33228,7 @@ Phaser.GameObjectFactory.prototype = {
|
|||
* @param {number} [y=0] - The y coordinate of the creature. The coordinate is relative to any parent container this creature may be in.
|
||||
* @param {string|PIXI.Texture} [key] - The image used as a texture by this creature object during rendering. If a string Phaser will get for an entry in the Image Cache. Or it can be an instance of a PIXI.Texture.
|
||||
* @param {Phaser.Group} [group] - Optional Group to add the object to. If not specified it will be added to the World group.
|
||||
* @returns {Phaser.Creature} The newly created Sprite object.
|
||||
* @returns {Phaser.Creature} The newly created Creature object.
|
||||
*/
|
||||
creature: function (x, y, key, mesh, group) {
|
||||
|
||||
|
@ -41646,6 +41643,18 @@ Phaser.Text = function (game, x, y, text, style) {
|
|||
*/
|
||||
this.splitRegExp = /(?:\r\n|\r|\n)/;
|
||||
|
||||
|
||||
/** The maximum number of characters that can be set.
|
||||
* @property {number} characterLimitSize
|
||||
*/
|
||||
this.characterLimitSize = -1;
|
||||
|
||||
/** The suffix that is applied to truncated text that is longer than the
|
||||
* characterLimitSize.
|
||||
* @property {string} characterLimitSuffix
|
||||
*/
|
||||
this.characterLimitSuffix = '';
|
||||
|
||||
/**
|
||||
* @property {number} _res - Internal canvas resolution var.
|
||||
* @private
|
||||
|
@ -41882,6 +41891,10 @@ Phaser.Text.prototype.updateText = function () {
|
|||
|
||||
var outputText = this.text;
|
||||
|
||||
if (this.characterLimitSize > -1 && this.characterLimitSize < outputText.length) {
|
||||
outputText = this.text.substring(0, this.characterLimitSize) + this.characterLimitSuffix;
|
||||
}
|
||||
|
||||
if (this.style.wordWrap)
|
||||
{
|
||||
outputText = this.runWordWrap(this.text);
|
||||
|
@ -43163,6 +43176,22 @@ Phaser.Text.prototype.getBounds = function (matrix) {
|
|||
|
||||
};
|
||||
|
||||
/**
|
||||
* Sets the character limit of the text, with a suffix.
|
||||
* If the text is longer than this limit, it is truncated and the suffix is appended.
|
||||
*
|
||||
* @method Phaser.Text#setCharacterLimit
|
||||
* @param {number} [characterLimit] - The x coordinate of the Text Bounds region.
|
||||
* @param {string} [suffix] - The suffix to append to the truncated text.
|
||||
*/
|
||||
Phaser.Text.prototype.setCharacterLimit = function (characterLimit, suffix) {
|
||||
|
||||
this.characterLimitSuffix = suffix == undefined ? '' : suffix;
|
||||
this.characterLimitSize = characterLimit;
|
||||
|
||||
this.updateText();
|
||||
}
|
||||
|
||||
/**
|
||||
* The text to be displayed by this Text object.
|
||||
* Use a \n to insert a carriage return and split the text.
|
||||
|
@ -55161,6 +55190,9 @@ Phaser.AnimationManager.prototype = {
|
|||
*
|
||||
* If the requested animation is already playing this request will be ignored.
|
||||
* If you need to reset an already running animation do so directly on the Animation object itself.
|
||||
*
|
||||
* If you need to jump to a specific frame of this animation, then call `play` and immediately after it,
|
||||
* set the frame you require (i.e. `animation.play(); animation.frame = 4`).
|
||||
*
|
||||
* @method Phaser.AnimationManager#play
|
||||
* @param {string} name - The name of the animation to be played, e.g. "fire", "walk", "jump".
|
||||
|
@ -55638,6 +55670,9 @@ Phaser.Animation.prototype = {
|
|||
|
||||
/**
|
||||
* Plays this animation.
|
||||
*
|
||||
* If you need to jump to a specific frame of this animation, then call `play` and immediately after it,
|
||||
* set the frame you require (i.e. `animation.play(); animation.frame = 4`).
|
||||
*
|
||||
* @method Phaser.Animation#play
|
||||
* @param {number} [frameRate=null] - The framerate to play the animation at. The speed is given in frames per second. If not provided the previously set frameRate of the Animation is used.
|
||||
|
@ -59214,7 +59249,7 @@ Phaser.Cache.prototype = {
|
|||
*/
|
||||
removeTextureAtlas: function (key) {
|
||||
|
||||
delete this._cache.atlas[key];
|
||||
delete this._cache.image[key];
|
||||
|
||||
},
|
||||
|
||||
|
@ -61060,14 +61095,14 @@ Phaser.Loader.prototype = {
|
|||
},
|
||||
|
||||
/**
|
||||
* Add a synchronization point to the assets/files added within the supplied callback.
|
||||
* Add a synchronization point to the assets / files added within the supplied callback.
|
||||
*
|
||||
* A synchronization point denotes that an asset _must_ be completely loaded before
|
||||
* subsequent assets can be loaded. An asset marked as a sync-point does not need to wait
|
||||
* for previous assets to load (unless they are sync-points). Resources, such as packs, may still
|
||||
* be downloaded around sync-points, as long as they do not finalize loading.
|
||||
*
|
||||
* @method Phaser.Loader#withSyncPoints
|
||||
* @method Phaser.Loader#withSyncPoint
|
||||
* @param {function} callback - The callback is invoked and is supplied with a single argument: the loader.
|
||||
* @param {object} [callbackContext=(loader)] - Context for the callback.
|
||||
* @return {Phaser.Loader} This Loader instance.
|
||||
|
@ -69221,7 +69256,7 @@ Phaser.ArrayUtils = {
|
|||
* Will return null if there are no array items that fall within the specified range
|
||||
* or if there is no item for the randomly chosen index.
|
||||
*
|
||||
* @method
|
||||
* @method Phaser.ArrayUtils.getRandomItem
|
||||
* @param {any[]} objects - An array of objects.
|
||||
* @param {integer} startIndex - Optional offset off the front of the array. Default value is 0, or the beginning of the array.
|
||||
* @param {integer} length - Optional restriction on the number of values you want to randomly select from.
|
||||
|
@ -69245,7 +69280,7 @@ Phaser.ArrayUtils = {
|
|||
* Will return null if there are no array items that fall within the specified range
|
||||
* or if there is no item for the randomly chosen index.
|
||||
*
|
||||
* @method
|
||||
* @method Phaser.ArrayUtils.removeRandomItem
|
||||
* @param {any[]} objects - An array of objects.
|
||||
* @param {integer} startIndex - Optional offset off the front of the array. Default value is 0, or the beginning of the array.
|
||||
* @param {integer} length - Optional restriction on the number of values you want to randomly select from.
|
||||
|
@ -69276,7 +69311,7 @@ Phaser.ArrayUtils = {
|
|||
/**
|
||||
* A standard Fisher-Yates Array shuffle implementation which modifies the array in place.
|
||||
*
|
||||
* @method
|
||||
* @method Phaser.ArrayUtils.shuffle
|
||||
* @param {any[]} array - The array to shuffle.
|
||||
* @return {any[]} The original array, now shuffled.
|
||||
*/
|
||||
|
@ -69297,7 +69332,7 @@ Phaser.ArrayUtils = {
|
|||
/**
|
||||
* Transposes the elements of the given matrix (array of arrays).
|
||||
*
|
||||
* @method
|
||||
* @method Phaser.ArrayUtils.transposeMatrix
|
||||
* @param {Array<any[]>} array - The matrix to transpose.
|
||||
* @return {Array<any[]>} A new transposed matrix
|
||||
*/
|
||||
|
@ -69327,7 +69362,7 @@ Phaser.ArrayUtils = {
|
|||
*
|
||||
* Based on the routine from {@link http://jsfiddle.net/MrPolywhirl/NH42z/}.
|
||||
*
|
||||
* @method
|
||||
* @method Phaser.ArrayUtils.rotateMatrix
|
||||
* @param {Array<any[]>} matrix - The array to rotate; this matrix _may_ be altered.
|
||||
* @param {number|string} direction - The amount to rotate: the rotation in degrees (90, -90, 270, -270, 180) or a string command ('rotateLeft', 'rotateRight' or 'rotate180').
|
||||
* @return {Array<any[]>} The rotated matrix. The source matrix should be discarded for the returned matrix.
|
||||
|
@ -69367,7 +69402,7 @@ Phaser.ArrayUtils = {
|
|||
* Snaps a value to the nearest value in an array.
|
||||
* The result will always be in the range `[first_value, last_value]`.
|
||||
*
|
||||
* @method
|
||||
* @method Phaser.ArrayUtils.findClosest
|
||||
* @param {number} value - The search value
|
||||
* @param {number[]} arr - The input array which _must_ be sorted.
|
||||
* @return {number} The nearest value found.
|
||||
|
@ -69466,7 +69501,7 @@ Phaser.ArrayUtils = {
|
|||
* Create an array representing the inclusive range of numbers (usually integers) in `[start, end]`.
|
||||
* This is equivalent to `numberArrayStep(start, end, 1)`.
|
||||
*
|
||||
* @method Phaser.ArrayUtils#numberArray
|
||||
* @method Phaser.ArrayUtils.numberArray
|
||||
* @param {number} start - The minimum value the array starts with.
|
||||
* @param {number} end - The maximum value the array contains.
|
||||
* @return {number[]} The array of number values.
|
||||
|
@ -69493,7 +69528,7 @@ Phaser.ArrayUtils = {
|
|||
* Certain values for `start` and `end` (eg. NaN/undefined/null) are currently coerced to 0;
|
||||
* for forward compatibility make sure to pass in actual numbers.
|
||||
*
|
||||
* @method Phaser.ArrayUtils#numberArrayStep
|
||||
* @method Phaser.ArrayUtils.numberArrayStep
|
||||
* @param {number} start - The start of the range.
|
||||
* @param {number} [end] - The end of the range.
|
||||
* @param {number} [step=1] - The value to increment or decrement by.
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -7,7 +7,7 @@
|
|||
*
|
||||
* Phaser - http://phaser.io
|
||||
*
|
||||
* v2.7.1 "2016-11-28" - Built: Mon Nov 28 2016 18:47:34
|
||||
* v2.7.2 "2016-12-06" - Built: Tue Dec 06 2016 23:48:34
|
||||
*
|
||||
* By Richard Davey http://www.photonstorm.com @photonstorm
|
||||
*
|
||||
|
@ -53,7 +53,7 @@ var Phaser = Phaser || { // jshint ignore:line
|
|||
* @constant
|
||||
* @type {string}
|
||||
*/
|
||||
VERSION: '2.7.1',
|
||||
VERSION: '2.7.2',
|
||||
|
||||
/**
|
||||
* An array of Phaser game instances.
|
||||
|
@ -9867,7 +9867,7 @@ Phaser.Group.prototype.add = function (child, silent, index) {
|
|||
*/
|
||||
Phaser.Group.prototype.addAt = function (child, index, silent) {
|
||||
|
||||
this.add(child, silent, index);
|
||||
return this.add(child, silent, index);
|
||||
|
||||
};
|
||||
|
||||
|
@ -24330,7 +24330,8 @@ Phaser.Component.FixedToCamera.prototype = {
|
|||
_fixedToCamera: false,
|
||||
|
||||
/**
|
||||
* A Game Object that is "fixed" to the camera uses its x/y coordinates as offsets from the top left of the camera during rendering.
|
||||
* A Game Object that is "fixed" to the camera is rendered at a given x/y offsets from the top left of the camera. The offsets
|
||||
* are stored in the `cameraOffset` property, which is initialized with the current object coordinates.
|
||||
*
|
||||
* The values are adjusted at the rendering stage, overriding the Game Objects actual world position.
|
||||
*
|
||||
|
@ -24338,8 +24339,6 @@ Phaser.Component.FixedToCamera.prototype = {
|
|||
* the camera is viewing. This is useful if for example this Game Object is a UI item that you wish to be visible at all times
|
||||
* regardless where in the world the camera is.
|
||||
*
|
||||
* The offsets are stored in the `cameraOffset` property.
|
||||
*
|
||||
* Note that the `cameraOffset` values are in addition to any parent of this Game Object on the display list.
|
||||
*
|
||||
* Be careful not to set `fixedToCamera` on Game Objects which are in Groups that already have `fixedToCamera` enabled on them.
|
||||
|
@ -25778,7 +25777,7 @@ Phaser.GameObjectFactory.prototype = {
|
|||
* @param {number} [y=0] - The y coordinate of the creature. The coordinate is relative to any parent container this creature may be in.
|
||||
* @param {string|PIXI.Texture} [key] - The image used as a texture by this creature object during rendering. If a string Phaser will get for an entry in the Image Cache. Or it can be an instance of a PIXI.Texture.
|
||||
* @param {Phaser.Group} [group] - Optional Group to add the object to. If not specified it will be added to the World group.
|
||||
* @returns {Phaser.Creature} The newly created Sprite object.
|
||||
* @returns {Phaser.Creature} The newly created Creature object.
|
||||
*/
|
||||
creature: function (x, y, key, mesh, group) {
|
||||
|
||||
|
@ -34193,6 +34192,18 @@ Phaser.Text = function (game, x, y, text, style) {
|
|||
*/
|
||||
this.splitRegExp = /(?:\r\n|\r|\n)/;
|
||||
|
||||
|
||||
/** The maximum number of characters that can be set.
|
||||
* @property {number} characterLimitSize
|
||||
*/
|
||||
this.characterLimitSize = -1;
|
||||
|
||||
/** The suffix that is applied to truncated text that is longer than the
|
||||
* characterLimitSize.
|
||||
* @property {string} characterLimitSuffix
|
||||
*/
|
||||
this.characterLimitSuffix = '';
|
||||
|
||||
/**
|
||||
* @property {number} _res - Internal canvas resolution var.
|
||||
* @private
|
||||
|
@ -34429,6 +34440,10 @@ Phaser.Text.prototype.updateText = function () {
|
|||
|
||||
var outputText = this.text;
|
||||
|
||||
if (this.characterLimitSize > -1 && this.characterLimitSize < outputText.length) {
|
||||
outputText = this.text.substring(0, this.characterLimitSize) + this.characterLimitSuffix;
|
||||
}
|
||||
|
||||
if (this.style.wordWrap)
|
||||
{
|
||||
outputText = this.runWordWrap(this.text);
|
||||
|
@ -35710,6 +35725,22 @@ Phaser.Text.prototype.getBounds = function (matrix) {
|
|||
|
||||
};
|
||||
|
||||
/**
|
||||
* Sets the character limit of the text, with a suffix.
|
||||
* If the text is longer than this limit, it is truncated and the suffix is appended.
|
||||
*
|
||||
* @method Phaser.Text#setCharacterLimit
|
||||
* @param {number} [characterLimit] - The x coordinate of the Text Bounds region.
|
||||
* @param {string} [suffix] - The suffix to append to the truncated text.
|
||||
*/
|
||||
Phaser.Text.prototype.setCharacterLimit = function (characterLimit, suffix) {
|
||||
|
||||
this.characterLimitSuffix = suffix == undefined ? '' : suffix;
|
||||
this.characterLimitSize = characterLimit;
|
||||
|
||||
this.updateText();
|
||||
}
|
||||
|
||||
/**
|
||||
* The text to be displayed by this Text object.
|
||||
* Use a \n to insert a carriage return and split the text.
|
||||
|
@ -47708,6 +47739,9 @@ Phaser.AnimationManager.prototype = {
|
|||
*
|
||||
* If the requested animation is already playing this request will be ignored.
|
||||
* If you need to reset an already running animation do so directly on the Animation object itself.
|
||||
*
|
||||
* If you need to jump to a specific frame of this animation, then call `play` and immediately after it,
|
||||
* set the frame you require (i.e. `animation.play(); animation.frame = 4`).
|
||||
*
|
||||
* @method Phaser.AnimationManager#play
|
||||
* @param {string} name - The name of the animation to be played, e.g. "fire", "walk", "jump".
|
||||
|
@ -48185,6 +48219,9 @@ Phaser.Animation.prototype = {
|
|||
|
||||
/**
|
||||
* Plays this animation.
|
||||
*
|
||||
* If you need to jump to a specific frame of this animation, then call `play` and immediately after it,
|
||||
* set the frame you require (i.e. `animation.play(); animation.frame = 4`).
|
||||
*
|
||||
* @method Phaser.Animation#play
|
||||
* @param {number} [frameRate=null] - The framerate to play the animation at. The speed is given in frames per second. If not provided the previously set frameRate of the Animation is used.
|
||||
|
@ -51761,7 +51798,7 @@ Phaser.Cache.prototype = {
|
|||
*/
|
||||
removeTextureAtlas: function (key) {
|
||||
|
||||
delete this._cache.atlas[key];
|
||||
delete this._cache.image[key];
|
||||
|
||||
},
|
||||
|
||||
|
@ -53607,14 +53644,14 @@ Phaser.Loader.prototype = {
|
|||
},
|
||||
|
||||
/**
|
||||
* Add a synchronization point to the assets/files added within the supplied callback.
|
||||
* Add a synchronization point to the assets / files added within the supplied callback.
|
||||
*
|
||||
* A synchronization point denotes that an asset _must_ be completely loaded before
|
||||
* subsequent assets can be loaded. An asset marked as a sync-point does not need to wait
|
||||
* for previous assets to load (unless they are sync-points). Resources, such as packs, may still
|
||||
* be downloaded around sync-points, as long as they do not finalize loading.
|
||||
*
|
||||
* @method Phaser.Loader#withSyncPoints
|
||||
* @method Phaser.Loader#withSyncPoint
|
||||
* @param {function} callback - The callback is invoked and is supplied with a single argument: the loader.
|
||||
* @param {object} [callbackContext=(loader)] - Context for the callback.
|
||||
* @return {Phaser.Loader} This Loader instance.
|
||||
|
@ -61768,7 +61805,7 @@ Phaser.ArrayUtils = {
|
|||
* Will return null if there are no array items that fall within the specified range
|
||||
* or if there is no item for the randomly chosen index.
|
||||
*
|
||||
* @method
|
||||
* @method Phaser.ArrayUtils.getRandomItem
|
||||
* @param {any[]} objects - An array of objects.
|
||||
* @param {integer} startIndex - Optional offset off the front of the array. Default value is 0, or the beginning of the array.
|
||||
* @param {integer} length - Optional restriction on the number of values you want to randomly select from.
|
||||
|
@ -61792,7 +61829,7 @@ Phaser.ArrayUtils = {
|
|||
* Will return null if there are no array items that fall within the specified range
|
||||
* or if there is no item for the randomly chosen index.
|
||||
*
|
||||
* @method
|
||||
* @method Phaser.ArrayUtils.removeRandomItem
|
||||
* @param {any[]} objects - An array of objects.
|
||||
* @param {integer} startIndex - Optional offset off the front of the array. Default value is 0, or the beginning of the array.
|
||||
* @param {integer} length - Optional restriction on the number of values you want to randomly select from.
|
||||
|
@ -61823,7 +61860,7 @@ Phaser.ArrayUtils = {
|
|||
/**
|
||||
* A standard Fisher-Yates Array shuffle implementation which modifies the array in place.
|
||||
*
|
||||
* @method
|
||||
* @method Phaser.ArrayUtils.shuffle
|
||||
* @param {any[]} array - The array to shuffle.
|
||||
* @return {any[]} The original array, now shuffled.
|
||||
*/
|
||||
|
@ -61844,7 +61881,7 @@ Phaser.ArrayUtils = {
|
|||
/**
|
||||
* Transposes the elements of the given matrix (array of arrays).
|
||||
*
|
||||
* @method
|
||||
* @method Phaser.ArrayUtils.transposeMatrix
|
||||
* @param {Array<any[]>} array - The matrix to transpose.
|
||||
* @return {Array<any[]>} A new transposed matrix
|
||||
*/
|
||||
|
@ -61874,7 +61911,7 @@ Phaser.ArrayUtils = {
|
|||
*
|
||||
* Based on the routine from {@link http://jsfiddle.net/MrPolywhirl/NH42z/}.
|
||||
*
|
||||
* @method
|
||||
* @method Phaser.ArrayUtils.rotateMatrix
|
||||
* @param {Array<any[]>} matrix - The array to rotate; this matrix _may_ be altered.
|
||||
* @param {number|string} direction - The amount to rotate: the rotation in degrees (90, -90, 270, -270, 180) or a string command ('rotateLeft', 'rotateRight' or 'rotate180').
|
||||
* @return {Array<any[]>} The rotated matrix. The source matrix should be discarded for the returned matrix.
|
||||
|
@ -61914,7 +61951,7 @@ Phaser.ArrayUtils = {
|
|||
* Snaps a value to the nearest value in an array.
|
||||
* The result will always be in the range `[first_value, last_value]`.
|
||||
*
|
||||
* @method
|
||||
* @method Phaser.ArrayUtils.findClosest
|
||||
* @param {number} value - The search value
|
||||
* @param {number[]} arr - The input array which _must_ be sorted.
|
||||
* @return {number} The nearest value found.
|
||||
|
@ -62013,7 +62050,7 @@ Phaser.ArrayUtils = {
|
|||
* Create an array representing the inclusive range of numbers (usually integers) in `[start, end]`.
|
||||
* This is equivalent to `numberArrayStep(start, end, 1)`.
|
||||
*
|
||||
* @method Phaser.ArrayUtils#numberArray
|
||||
* @method Phaser.ArrayUtils.numberArray
|
||||
* @param {number} start - The minimum value the array starts with.
|
||||
* @param {number} end - The maximum value the array contains.
|
||||
* @return {number[]} The array of number values.
|
||||
|
@ -62040,7 +62077,7 @@ Phaser.ArrayUtils = {
|
|||
* Certain values for `start` and `end` (eg. NaN/undefined/null) are currently coerced to 0;
|
||||
* for forward compatibility make sure to pass in actual numbers.
|
||||
*
|
||||
* @method Phaser.ArrayUtils#numberArrayStep
|
||||
* @method Phaser.ArrayUtils.numberArrayStep
|
||||
* @param {number} start - The start of the range.
|
||||
* @param {number} [end] - The end of the range.
|
||||
* @param {number} [step=1] - The value to increment or decrement by.
|
||||
|
@ -79389,10 +79426,10 @@ Phaser.Particles.Arcade.Emitter = function (game, x, y, maxParticles) {
|
|||
this.alphaData = null;
|
||||
|
||||
/**
|
||||
* @property {number} gravity - Sets the `body.gravity.y` of each particle sprite to this value on launch.
|
||||
* @property {Phaser.Point} gravity - Sets the `body.gravity` of each particle sprite to this on launch.
|
||||
* @default
|
||||
*/
|
||||
this.gravity = 100;
|
||||
this.gravity = new Phaser.Point(0, 100);
|
||||
|
||||
/**
|
||||
* @property {any} particleClass - For emitting your own particle class types. They must extend Phaser.Particle.
|
||||
|
@ -79750,6 +79787,7 @@ Phaser.Particles.Arcade.Emitter.prototype.explode = function (lifespan, quantity
|
|||
*/
|
||||
Phaser.Particles.Arcade.Emitter.prototype.flow = function (lifespan, frequency, quantity, total, immediate) {
|
||||
|
||||
if (frequency === undefined || frequency === null) { frequency = 250; }
|
||||
if (quantity === undefined || quantity === 0) { quantity = 1; }
|
||||
if (total === undefined) { total = -1; }
|
||||
if (immediate === undefined) { immediate = true; }
|
||||
|
@ -79949,7 +79987,7 @@ Phaser.Particles.Arcade.Emitter.prototype.emitParticle = function (x, y, key, fr
|
|||
body.velocity.y = rnd.between(this.minParticleSpeed.y, this.maxParticleSpeed.y);
|
||||
body.angularVelocity = rnd.between(this.minRotation, this.maxRotation);
|
||||
|
||||
body.gravity.y = this.gravity;
|
||||
body.gravity = this.gravity;
|
||||
body.angularDrag = this.angularDrag;
|
||||
|
||||
particle.onEmit();
|
||||
|
|
File diff suppressed because one or more lines are too long
30
v2-community/build/custom/phaser-split.min.js
vendored
30
v2-community/build/custom/phaser-split.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -7,7 +7,7 @@
|
|||
*
|
||||
* Phaser - http://phaser.io
|
||||
*
|
||||
* v2.7.1 "2016-11-28" - Built: Mon Nov 28 2016 18:47:34
|
||||
* v2.7.2 "2016-12-06" - Built: Tue Dec 06 2016 23:48:33
|
||||
*
|
||||
* By Richard Davey http://www.photonstorm.com @photonstorm
|
||||
*
|
||||
|
@ -69,7 +69,7 @@ var PIXI = PIXI || {};
|
|||
*
|
||||
* It is used internally by the likes of PIXI.Sprite.
|
||||
*
|
||||
* @class PIXI.DisplayObject
|
||||
* @class DisplayObject
|
||||
* @constructor
|
||||
*/
|
||||
PIXI.DisplayObject = function () {
|
||||
|
@ -6896,7 +6896,6 @@ PIXI.CanvasRenderer.prototype.mapBlendModes = function () {
|
|||
* A texture stores the information that represents an image. All textures have a base texture.
|
||||
*
|
||||
* @class BaseTexture
|
||||
* @uses EventTarget
|
||||
* @constructor
|
||||
* @param source {String|Canvas} the source object (image or canvas)
|
||||
* @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values
|
||||
|
@ -7164,7 +7163,6 @@ PIXI.TextureSilentFail = false;
|
|||
* to the display list directly. Instead use it as the texture for a PIXI.Sprite. If no frame is provided then the whole image is used.
|
||||
*
|
||||
* @class Texture
|
||||
* @uses EventTarget
|
||||
* @constructor
|
||||
* @param baseTexture {BaseTexture} The base texture source to create the texture from
|
||||
* @param frame {Rectangle} The rectangle frame of the texture to show
|
||||
|
|
File diff suppressed because one or more lines are too long
2
v2-community/build/custom/pixi.min.js
vendored
2
v2-community/build/custom/pixi.min.js
vendored
File diff suppressed because one or more lines are too long
2
v2-community/build/p2.min.js
vendored
2
v2-community/build/p2.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -7,7 +7,7 @@
|
|||
*
|
||||
* Phaser - http://phaser.io
|
||||
*
|
||||
* v2.7.1 "2016-11-28" - Built: Mon Nov 28 2016 18:47:40
|
||||
* v2.7.2 "2016-12-06" - Built: Tue Dec 06 2016 23:48:41
|
||||
*
|
||||
* By Richard Davey http://www.photonstorm.com @photonstorm
|
||||
*
|
||||
|
@ -53,7 +53,7 @@ var Phaser = Phaser || { // jshint ignore:line
|
|||
* @constant
|
||||
* @type {string}
|
||||
*/
|
||||
VERSION: '2.7.1',
|
||||
VERSION: '2.7.2',
|
||||
|
||||
/**
|
||||
* An array of Phaser game instances.
|
||||
|
@ -9867,7 +9867,7 @@ Phaser.Group.prototype.add = function (child, silent, index) {
|
|||
*/
|
||||
Phaser.Group.prototype.addAt = function (child, index, silent) {
|
||||
|
||||
this.add(child, silent, index);
|
||||
return this.add(child, silent, index);
|
||||
|
||||
};
|
||||
|
||||
|
@ -24330,7 +24330,8 @@ Phaser.Component.FixedToCamera.prototype = {
|
|||
_fixedToCamera: false,
|
||||
|
||||
/**
|
||||
* A Game Object that is "fixed" to the camera uses its x/y coordinates as offsets from the top left of the camera during rendering.
|
||||
* A Game Object that is "fixed" to the camera is rendered at a given x/y offsets from the top left of the camera. The offsets
|
||||
* are stored in the `cameraOffset` property, which is initialized with the current object coordinates.
|
||||
*
|
||||
* The values are adjusted at the rendering stage, overriding the Game Objects actual world position.
|
||||
*
|
||||
|
@ -24338,8 +24339,6 @@ Phaser.Component.FixedToCamera.prototype = {
|
|||
* the camera is viewing. This is useful if for example this Game Object is a UI item that you wish to be visible at all times
|
||||
* regardless where in the world the camera is.
|
||||
*
|
||||
* The offsets are stored in the `cameraOffset` property.
|
||||
*
|
||||
* Note that the `cameraOffset` values are in addition to any parent of this Game Object on the display list.
|
||||
*
|
||||
* Be careful not to set `fixedToCamera` on Game Objects which are in Groups that already have `fixedToCamera` enabled on them.
|
||||
|
@ -25778,7 +25777,7 @@ Phaser.GameObjectFactory.prototype = {
|
|||
* @param {number} [y=0] - The y coordinate of the creature. The coordinate is relative to any parent container this creature may be in.
|
||||
* @param {string|PIXI.Texture} [key] - The image used as a texture by this creature object during rendering. If a string Phaser will get for an entry in the Image Cache. Or it can be an instance of a PIXI.Texture.
|
||||
* @param {Phaser.Group} [group] - Optional Group to add the object to. If not specified it will be added to the World group.
|
||||
* @returns {Phaser.Creature} The newly created Sprite object.
|
||||
* @returns {Phaser.Creature} The newly created Creature object.
|
||||
*/
|
||||
creature: function (x, y, key, mesh, group) {
|
||||
|
||||
|
@ -34193,6 +34192,18 @@ Phaser.Text = function (game, x, y, text, style) {
|
|||
*/
|
||||
this.splitRegExp = /(?:\r\n|\r|\n)/;
|
||||
|
||||
|
||||
/** The maximum number of characters that can be set.
|
||||
* @property {number} characterLimitSize
|
||||
*/
|
||||
this.characterLimitSize = -1;
|
||||
|
||||
/** The suffix that is applied to truncated text that is longer than the
|
||||
* characterLimitSize.
|
||||
* @property {string} characterLimitSuffix
|
||||
*/
|
||||
this.characterLimitSuffix = '';
|
||||
|
||||
/**
|
||||
* @property {number} _res - Internal canvas resolution var.
|
||||
* @private
|
||||
|
@ -34429,6 +34440,10 @@ Phaser.Text.prototype.updateText = function () {
|
|||
|
||||
var outputText = this.text;
|
||||
|
||||
if (this.characterLimitSize > -1 && this.characterLimitSize < outputText.length) {
|
||||
outputText = this.text.substring(0, this.characterLimitSize) + this.characterLimitSuffix;
|
||||
}
|
||||
|
||||
if (this.style.wordWrap)
|
||||
{
|
||||
outputText = this.runWordWrap(this.text);
|
||||
|
@ -35710,6 +35725,22 @@ Phaser.Text.prototype.getBounds = function (matrix) {
|
|||
|
||||
};
|
||||
|
||||
/**
|
||||
* Sets the character limit of the text, with a suffix.
|
||||
* If the text is longer than this limit, it is truncated and the suffix is appended.
|
||||
*
|
||||
* @method Phaser.Text#setCharacterLimit
|
||||
* @param {number} [characterLimit] - The x coordinate of the Text Bounds region.
|
||||
* @param {string} [suffix] - The suffix to append to the truncated text.
|
||||
*/
|
||||
Phaser.Text.prototype.setCharacterLimit = function (characterLimit, suffix) {
|
||||
|
||||
this.characterLimitSuffix = suffix == undefined ? '' : suffix;
|
||||
this.characterLimitSize = characterLimit;
|
||||
|
||||
this.updateText();
|
||||
}
|
||||
|
||||
/**
|
||||
* The text to be displayed by this Text object.
|
||||
* Use a \n to insert a carriage return and split the text.
|
||||
|
@ -47708,6 +47739,9 @@ Phaser.AnimationManager.prototype = {
|
|||
*
|
||||
* If the requested animation is already playing this request will be ignored.
|
||||
* If you need to reset an already running animation do so directly on the Animation object itself.
|
||||
*
|
||||
* If you need to jump to a specific frame of this animation, then call `play` and immediately after it,
|
||||
* set the frame you require (i.e. `animation.play(); animation.frame = 4`).
|
||||
*
|
||||
* @method Phaser.AnimationManager#play
|
||||
* @param {string} name - The name of the animation to be played, e.g. "fire", "walk", "jump".
|
||||
|
@ -48185,6 +48219,9 @@ Phaser.Animation.prototype = {
|
|||
|
||||
/**
|
||||
* Plays this animation.
|
||||
*
|
||||
* If you need to jump to a specific frame of this animation, then call `play` and immediately after it,
|
||||
* set the frame you require (i.e. `animation.play(); animation.frame = 4`).
|
||||
*
|
||||
* @method Phaser.Animation#play
|
||||
* @param {number} [frameRate=null] - The framerate to play the animation at. The speed is given in frames per second. If not provided the previously set frameRate of the Animation is used.
|
||||
|
@ -51761,7 +51798,7 @@ Phaser.Cache.prototype = {
|
|||
*/
|
||||
removeTextureAtlas: function (key) {
|
||||
|
||||
delete this._cache.atlas[key];
|
||||
delete this._cache.image[key];
|
||||
|
||||
},
|
||||
|
||||
|
@ -53607,14 +53644,14 @@ Phaser.Loader.prototype = {
|
|||
},
|
||||
|
||||
/**
|
||||
* Add a synchronization point to the assets/files added within the supplied callback.
|
||||
* Add a synchronization point to the assets / files added within the supplied callback.
|
||||
*
|
||||
* A synchronization point denotes that an asset _must_ be completely loaded before
|
||||
* subsequent assets can be loaded. An asset marked as a sync-point does not need to wait
|
||||
* for previous assets to load (unless they are sync-points). Resources, such as packs, may still
|
||||
* be downloaded around sync-points, as long as they do not finalize loading.
|
||||
*
|
||||
* @method Phaser.Loader#withSyncPoints
|
||||
* @method Phaser.Loader#withSyncPoint
|
||||
* @param {function} callback - The callback is invoked and is supplied with a single argument: the loader.
|
||||
* @param {object} [callbackContext=(loader)] - Context for the callback.
|
||||
* @return {Phaser.Loader} This Loader instance.
|
||||
|
@ -61768,7 +61805,7 @@ Phaser.ArrayUtils = {
|
|||
* Will return null if there are no array items that fall within the specified range
|
||||
* or if there is no item for the randomly chosen index.
|
||||
*
|
||||
* @method
|
||||
* @method Phaser.ArrayUtils.getRandomItem
|
||||
* @param {any[]} objects - An array of objects.
|
||||
* @param {integer} startIndex - Optional offset off the front of the array. Default value is 0, or the beginning of the array.
|
||||
* @param {integer} length - Optional restriction on the number of values you want to randomly select from.
|
||||
|
@ -61792,7 +61829,7 @@ Phaser.ArrayUtils = {
|
|||
* Will return null if there are no array items that fall within the specified range
|
||||
* or if there is no item for the randomly chosen index.
|
||||
*
|
||||
* @method
|
||||
* @method Phaser.ArrayUtils.removeRandomItem
|
||||
* @param {any[]} objects - An array of objects.
|
||||
* @param {integer} startIndex - Optional offset off the front of the array. Default value is 0, or the beginning of the array.
|
||||
* @param {integer} length - Optional restriction on the number of values you want to randomly select from.
|
||||
|
@ -61823,7 +61860,7 @@ Phaser.ArrayUtils = {
|
|||
/**
|
||||
* A standard Fisher-Yates Array shuffle implementation which modifies the array in place.
|
||||
*
|
||||
* @method
|
||||
* @method Phaser.ArrayUtils.shuffle
|
||||
* @param {any[]} array - The array to shuffle.
|
||||
* @return {any[]} The original array, now shuffled.
|
||||
*/
|
||||
|
@ -61844,7 +61881,7 @@ Phaser.ArrayUtils = {
|
|||
/**
|
||||
* Transposes the elements of the given matrix (array of arrays).
|
||||
*
|
||||
* @method
|
||||
* @method Phaser.ArrayUtils.transposeMatrix
|
||||
* @param {Array<any[]>} array - The matrix to transpose.
|
||||
* @return {Array<any[]>} A new transposed matrix
|
||||
*/
|
||||
|
@ -61874,7 +61911,7 @@ Phaser.ArrayUtils = {
|
|||
*
|
||||
* Based on the routine from {@link http://jsfiddle.net/MrPolywhirl/NH42z/}.
|
||||
*
|
||||
* @method
|
||||
* @method Phaser.ArrayUtils.rotateMatrix
|
||||
* @param {Array<any[]>} matrix - The array to rotate; this matrix _may_ be altered.
|
||||
* @param {number|string} direction - The amount to rotate: the rotation in degrees (90, -90, 270, -270, 180) or a string command ('rotateLeft', 'rotateRight' or 'rotate180').
|
||||
* @return {Array<any[]>} The rotated matrix. The source matrix should be discarded for the returned matrix.
|
||||
|
@ -61914,7 +61951,7 @@ Phaser.ArrayUtils = {
|
|||
* Snaps a value to the nearest value in an array.
|
||||
* The result will always be in the range `[first_value, last_value]`.
|
||||
*
|
||||
* @method
|
||||
* @method Phaser.ArrayUtils.findClosest
|
||||
* @param {number} value - The search value
|
||||
* @param {number[]} arr - The input array which _must_ be sorted.
|
||||
* @return {number} The nearest value found.
|
||||
|
@ -62013,7 +62050,7 @@ Phaser.ArrayUtils = {
|
|||
* Create an array representing the inclusive range of numbers (usually integers) in `[start, end]`.
|
||||
* This is equivalent to `numberArrayStep(start, end, 1)`.
|
||||
*
|
||||
* @method Phaser.ArrayUtils#numberArray
|
||||
* @method Phaser.ArrayUtils.numberArray
|
||||
* @param {number} start - The minimum value the array starts with.
|
||||
* @param {number} end - The maximum value the array contains.
|
||||
* @return {number[]} The array of number values.
|
||||
|
@ -62040,7 +62077,7 @@ Phaser.ArrayUtils = {
|
|||
* Certain values for `start` and `end` (eg. NaN/undefined/null) are currently coerced to 0;
|
||||
* for forward compatibility make sure to pass in actual numbers.
|
||||
*
|
||||
* @method Phaser.ArrayUtils#numberArrayStep
|
||||
* @method Phaser.ArrayUtils.numberArrayStep
|
||||
* @param {number} start - The start of the range.
|
||||
* @param {number} [end] - The end of the range.
|
||||
* @param {number} [step=1] - The value to increment or decrement by.
|
||||
|
@ -79389,10 +79426,10 @@ Phaser.Particles.Arcade.Emitter = function (game, x, y, maxParticles) {
|
|||
this.alphaData = null;
|
||||
|
||||
/**
|
||||
* @property {number} gravity - Sets the `body.gravity.y` of each particle sprite to this value on launch.
|
||||
* @property {Phaser.Point} gravity - Sets the `body.gravity` of each particle sprite to this on launch.
|
||||
* @default
|
||||
*/
|
||||
this.gravity = 100;
|
||||
this.gravity = new Phaser.Point(0, 100);
|
||||
|
||||
/**
|
||||
* @property {any} particleClass - For emitting your own particle class types. They must extend Phaser.Particle.
|
||||
|
@ -79750,6 +79787,7 @@ Phaser.Particles.Arcade.Emitter.prototype.explode = function (lifespan, quantity
|
|||
*/
|
||||
Phaser.Particles.Arcade.Emitter.prototype.flow = function (lifespan, frequency, quantity, total, immediate) {
|
||||
|
||||
if (frequency === undefined || frequency === null) { frequency = 250; }
|
||||
if (quantity === undefined || quantity === 0) { quantity = 1; }
|
||||
if (total === undefined) { total = -1; }
|
||||
if (immediate === undefined) { immediate = true; }
|
||||
|
@ -79949,7 +79987,7 @@ Phaser.Particles.Arcade.Emitter.prototype.emitParticle = function (x, y, key, fr
|
|||
body.velocity.y = rnd.between(this.minParticleSpeed.y, this.maxParticleSpeed.y);
|
||||
body.angularVelocity = rnd.between(this.minRotation, this.maxRotation);
|
||||
|
||||
body.gravity.y = this.gravity;
|
||||
body.gravity = this.gravity;
|
||||
body.angularDrag = this.angularDrag;
|
||||
|
||||
particle.onEmit();
|
||||
|
|
File diff suppressed because one or more lines are too long
32
v2-community/build/phaser-creature.min.js
vendored
32
v2-community/build/phaser-creature.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -7,7 +7,7 @@
|
|||
*
|
||||
* Phaser - http://phaser.io
|
||||
*
|
||||
* v2.7.1 "2016-11-28" - Built: Mon Nov 28 2016 18:47:17
|
||||
* v2.7.2 "2016-12-06" - Built: Mon Dec 12 2016 07:00:15
|
||||
*
|
||||
* By Richard Davey http://www.photonstorm.com @photonstorm
|
||||
*
|
||||
|
@ -13707,7 +13707,7 @@ var PIXI = PIXI || {};
|
|||
*
|
||||
* It is used internally by the likes of PIXI.Sprite.
|
||||
*
|
||||
* @class PIXI.DisplayObject
|
||||
* @class DisplayObject
|
||||
* @constructor
|
||||
*/
|
||||
PIXI.DisplayObject = function () {
|
||||
|
@ -20534,7 +20534,6 @@ PIXI.CanvasRenderer.prototype.mapBlendModes = function () {
|
|||
* A texture stores the information that represents an image. All textures have a base texture.
|
||||
*
|
||||
* @class BaseTexture
|
||||
* @uses EventTarget
|
||||
* @constructor
|
||||
* @param source {String|Canvas} the source object (image or canvas)
|
||||
* @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values
|
||||
|
@ -20802,7 +20801,6 @@ PIXI.TextureSilentFail = false;
|
|||
* to the display list directly. Instead use it as the texture for a PIXI.Sprite. If no frame is provided then the whole image is used.
|
||||
*
|
||||
* @class Texture
|
||||
* @uses EventTarget
|
||||
* @constructor
|
||||
* @param baseTexture {BaseTexture} The base texture source to create the texture from
|
||||
* @param frame {Rectangle} The rectangle frame of the texture to show
|
||||
|
@ -21144,7 +21142,7 @@ var Phaser = Phaser || { // jshint ignore:line
|
|||
* @constant
|
||||
* @type {string}
|
||||
*/
|
||||
VERSION: '2.7.1',
|
||||
VERSION: '2.7.2',
|
||||
|
||||
/**
|
||||
* An array of Phaser game instances.
|
||||
|
@ -30958,7 +30956,7 @@ Phaser.Group.prototype.add = function (child, silent, index) {
|
|||
*/
|
||||
Phaser.Group.prototype.addAt = function (child, index, silent) {
|
||||
|
||||
this.add(child, silent, index);
|
||||
return this.add(child, silent, index);
|
||||
|
||||
};
|
||||
|
||||
|
@ -45421,7 +45419,8 @@ Phaser.Component.FixedToCamera.prototype = {
|
|||
_fixedToCamera: false,
|
||||
|
||||
/**
|
||||
* A Game Object that is "fixed" to the camera uses its x/y coordinates as offsets from the top left of the camera during rendering.
|
||||
* A Game Object that is "fixed" to the camera is rendered at a given x/y offsets from the top left of the camera. The offsets
|
||||
* are stored in the `cameraOffset` property, which is initialized with the current object coordinates.
|
||||
*
|
||||
* The values are adjusted at the rendering stage, overriding the Game Objects actual world position.
|
||||
*
|
||||
|
@ -45429,8 +45428,6 @@ Phaser.Component.FixedToCamera.prototype = {
|
|||
* the camera is viewing. This is useful if for example this Game Object is a UI item that you wish to be visible at all times
|
||||
* regardless where in the world the camera is.
|
||||
*
|
||||
* The offsets are stored in the `cameraOffset` property.
|
||||
*
|
||||
* Note that the `cameraOffset` values are in addition to any parent of this Game Object on the display list.
|
||||
*
|
||||
* Be careful not to set `fixedToCamera` on Game Objects which are in Groups that already have `fixedToCamera` enabled on them.
|
||||
|
@ -46869,7 +46866,7 @@ Phaser.GameObjectFactory.prototype = {
|
|||
* @param {number} [y=0] - The y coordinate of the creature. The coordinate is relative to any parent container this creature may be in.
|
||||
* @param {string|PIXI.Texture} [key] - The image used as a texture by this creature object during rendering. If a string Phaser will get for an entry in the Image Cache. Or it can be an instance of a PIXI.Texture.
|
||||
* @param {Phaser.Group} [group] - Optional Group to add the object to. If not specified it will be added to the World group.
|
||||
* @returns {Phaser.Creature} The newly created Sprite object.
|
||||
* @returns {Phaser.Creature} The newly created Creature object.
|
||||
*/
|
||||
creature: function (x, y, key, mesh, group) {
|
||||
|
||||
|
@ -55284,6 +55281,18 @@ Phaser.Text = function (game, x, y, text, style) {
|
|||
*/
|
||||
this.splitRegExp = /(?:\r\n|\r|\n)/;
|
||||
|
||||
|
||||
/** The maximum number of characters that can be set.
|
||||
* @property {number} characterLimitSize
|
||||
*/
|
||||
this.characterLimitSize = -1;
|
||||
|
||||
/** The suffix that is applied to truncated text that is longer than the
|
||||
* characterLimitSize.
|
||||
* @property {string} characterLimitSuffix
|
||||
*/
|
||||
this.characterLimitSuffix = '';
|
||||
|
||||
/**
|
||||
* @property {number} _res - Internal canvas resolution var.
|
||||
* @private
|
||||
|
@ -55520,6 +55529,10 @@ Phaser.Text.prototype.updateText = function () {
|
|||
|
||||
var outputText = this.text;
|
||||
|
||||
if (this.characterLimitSize > -1 && this.characterLimitSize < outputText.length) {
|
||||
outputText = this.text.substring(0, this.characterLimitSize) + this.characterLimitSuffix;
|
||||
}
|
||||
|
||||
if (this.style.wordWrap)
|
||||
{
|
||||
outputText = this.runWordWrap(this.text);
|
||||
|
@ -56801,6 +56814,22 @@ Phaser.Text.prototype.getBounds = function (matrix) {
|
|||
|
||||
};
|
||||
|
||||
/**
|
||||
* Sets the character limit of the text, with a suffix.
|
||||
* If the text is longer than this limit, it is truncated and the suffix is appended.
|
||||
*
|
||||
* @method Phaser.Text#setCharacterLimit
|
||||
* @param {number} [characterLimit] - The x coordinate of the Text Bounds region.
|
||||
* @param {string} [suffix] - The suffix to append to the truncated text.
|
||||
*/
|
||||
Phaser.Text.prototype.setCharacterLimit = function (characterLimit, suffix) {
|
||||
|
||||
this.characterLimitSuffix = suffix == undefined ? '' : suffix;
|
||||
this.characterLimitSize = characterLimit;
|
||||
|
||||
this.updateText();
|
||||
}
|
||||
|
||||
/**
|
||||
* The text to be displayed by this Text object.
|
||||
* Use a \n to insert a carriage return and split the text.
|
||||
|
@ -68799,6 +68828,9 @@ Phaser.AnimationManager.prototype = {
|
|||
*
|
||||
* If the requested animation is already playing this request will be ignored.
|
||||
* If you need to reset an already running animation do so directly on the Animation object itself.
|
||||
*
|
||||
* If you need to jump to a specific frame of this animation, then call `play` and immediately after it,
|
||||
* set the frame you require (i.e. `animation.play(); animation.frame = 4`).
|
||||
*
|
||||
* @method Phaser.AnimationManager#play
|
||||
* @param {string} name - The name of the animation to be played, e.g. "fire", "walk", "jump".
|
||||
|
@ -69276,6 +69308,9 @@ Phaser.Animation.prototype = {
|
|||
|
||||
/**
|
||||
* Plays this animation.
|
||||
*
|
||||
* If you need to jump to a specific frame of this animation, then call `play` and immediately after it,
|
||||
* set the frame you require (i.e. `animation.play(); animation.frame = 4`).
|
||||
*
|
||||
* @method Phaser.Animation#play
|
||||
* @param {number} [frameRate=null] - The framerate to play the animation at. The speed is given in frames per second. If not provided the previously set frameRate of the Animation is used.
|
||||
|
@ -71391,11 +71426,11 @@ Phaser.Cache.prototype = {
|
|||
|
||||
if (atlasType === 'json')
|
||||
{
|
||||
obj.font = Phaser.LoaderParser.jsonBitmapFont(atlasData, obj.base, xSpacing, ySpacing);
|
||||
obj.font = Phaser.LoaderParser.jsonBitmapFont(atlasData, obj.base, xSpacing, ySpacing, false, this.game.resolution);
|
||||
}
|
||||
else
|
||||
{
|
||||
obj.font = Phaser.LoaderParser.xmlBitmapFont(atlasData, obj.base, xSpacing, ySpacing);
|
||||
obj.font = Phaser.LoaderParser.xmlBitmapFont(atlasData, obj.base, xSpacing, ySpacing, false, this.game.resolution);
|
||||
}
|
||||
|
||||
this._cache.bitmapFont[key] = obj;
|
||||
|
@ -71447,12 +71482,12 @@ Phaser.Cache.prototype = {
|
|||
if (dataType === 'json')
|
||||
{
|
||||
fontData = this.getJSON(dataKey);
|
||||
obj.font = Phaser.LoaderParser.jsonBitmapFont(fontData, obj.base, xSpacing, ySpacing, frame);
|
||||
obj.font = Phaser.LoaderParser.jsonBitmapFont(fontData, obj.base, xSpacing, ySpacing, frame, this.game.resolution);
|
||||
}
|
||||
else
|
||||
{
|
||||
fontData = this.getXML(dataKey);
|
||||
obj.font = Phaser.LoaderParser.xmlBitmapFont(fontData, obj.base, xSpacing, ySpacing, frame);
|
||||
obj.font = Phaser.LoaderParser.xmlBitmapFont(fontData, obj.base, xSpacing, ySpacing, frame, this.game.resolution);
|
||||
}
|
||||
|
||||
this._cache.bitmapFont[key] = obj;
|
||||
|
@ -72852,7 +72887,7 @@ Phaser.Cache.prototype = {
|
|||
*/
|
||||
removeTextureAtlas: function (key) {
|
||||
|
||||
delete this._cache.atlas[key];
|
||||
delete this._cache.image[key];
|
||||
|
||||
},
|
||||
|
||||
|
@ -74698,14 +74733,14 @@ Phaser.Loader.prototype = {
|
|||
},
|
||||
|
||||
/**
|
||||
* Add a synchronization point to the assets/files added within the supplied callback.
|
||||
* Add a synchronization point to the assets / files added within the supplied callback.
|
||||
*
|
||||
* A synchronization point denotes that an asset _must_ be completely loaded before
|
||||
* subsequent assets can be loaded. An asset marked as a sync-point does not need to wait
|
||||
* for previous assets to load (unless they are sync-points). Resources, such as packs, may still
|
||||
* be downloaded around sync-points, as long as they do not finalize loading.
|
||||
*
|
||||
* @method Phaser.Loader#withSyncPoints
|
||||
* @method Phaser.Loader#withSyncPoint
|
||||
* @param {function} callback - The callback is invoked and is supplied with a single argument: the loader.
|
||||
* @param {object} [callbackContext=(loader)] - Context for the callback.
|
||||
* @return {Phaser.Loader} This Loader instance.
|
||||
|
@ -76182,7 +76217,7 @@ Phaser.LoaderParser = {
|
|||
* @param {Phaser.Frame} [frame] - Optional Frame, if this font is embedded in a texture atlas.
|
||||
* @return {object} The parsed Bitmap Font data.
|
||||
*/
|
||||
xmlBitmapFont: function (xml, baseTexture, xSpacing, ySpacing, frame) {
|
||||
xmlBitmapFont: function (xml, baseTexture, xSpacing, ySpacing, frame, resolution) {
|
||||
|
||||
var data = {};
|
||||
var info = xml.getElementsByTagName('info')[0];
|
||||
|
@ -76207,9 +76242,9 @@ Phaser.LoaderParser = {
|
|||
y: y + parseInt(letters[i].getAttribute('y'), 10),
|
||||
width: parseInt(letters[i].getAttribute('width'), 10),
|
||||
height: parseInt(letters[i].getAttribute('height'), 10),
|
||||
xOffset: parseInt(letters[i].getAttribute('xoffset'), 10),
|
||||
yOffset: parseInt(letters[i].getAttribute('yoffset'), 10),
|
||||
xAdvance: parseInt(letters[i].getAttribute('xadvance'), 10) + xSpacing,
|
||||
xOffset: parseInt(letters[i].getAttribute('xoffset'), 10) / resolution,
|
||||
yOffset: parseInt(letters[i].getAttribute('yoffset'), 10) / resolution,
|
||||
xAdvance: (parseInt(letters[i].getAttribute('xadvance'), 10) + xSpacing) / resolution,
|
||||
kerning: {}
|
||||
};
|
||||
}
|
||||
|
@ -76220,7 +76255,7 @@ Phaser.LoaderParser = {
|
|||
{
|
||||
var first = parseInt(kernings[i].getAttribute('first'), 10);
|
||||
var second = parseInt(kernings[i].getAttribute('second'), 10);
|
||||
var amount = parseInt(kernings[i].getAttribute('amount'), 10);
|
||||
var amount = parseInt(kernings[i].getAttribute('amount'), 10) / resolution;
|
||||
|
||||
data.chars[second].kerning[first] = amount;
|
||||
}
|
||||
|
@ -76263,9 +76298,9 @@ Phaser.LoaderParser = {
|
|||
y: y + parseInt(letter._y, 10),
|
||||
width: parseInt(letter._width, 10),
|
||||
height: parseInt(letter._height, 10),
|
||||
xOffset: parseInt(letter._xoffset, 10),
|
||||
yOffset: parseInt(letter._yoffset, 10),
|
||||
xAdvance: parseInt(letter._xadvance, 10) + xSpacing,
|
||||
xOffset: parseInt(letter._xoffset, 10) / resolution,
|
||||
yOffset: parseInt(letter._yoffset, 10) / resolution,
|
||||
xAdvance: (parseInt(letter._xadvance, 10) + xSpacing) / resolution,
|
||||
kerning: {}
|
||||
};
|
||||
}
|
||||
|
@ -76278,7 +76313,7 @@ Phaser.LoaderParser = {
|
|||
|
||||
function parseKerning(kerning) {
|
||||
|
||||
data.chars[kerning._second].kerning[kerning._first] = parseInt(kerning._amount, 10);
|
||||
data.chars[kerning._second].kerning[kerning._first] = parseInt(kerning._amount, 10) / resolution;
|
||||
|
||||
}
|
||||
|
||||
|
@ -82859,7 +82894,7 @@ Phaser.ArrayUtils = {
|
|||
* Will return null if there are no array items that fall within the specified range
|
||||
* or if there is no item for the randomly chosen index.
|
||||
*
|
||||
* @method
|
||||
* @method Phaser.ArrayUtils.getRandomItem
|
||||
* @param {any[]} objects - An array of objects.
|
||||
* @param {integer} startIndex - Optional offset off the front of the array. Default value is 0, or the beginning of the array.
|
||||
* @param {integer} length - Optional restriction on the number of values you want to randomly select from.
|
||||
|
@ -82883,7 +82918,7 @@ Phaser.ArrayUtils = {
|
|||
* Will return null if there are no array items that fall within the specified range
|
||||
* or if there is no item for the randomly chosen index.
|
||||
*
|
||||
* @method
|
||||
* @method Phaser.ArrayUtils.removeRandomItem
|
||||
* @param {any[]} objects - An array of objects.
|
||||
* @param {integer} startIndex - Optional offset off the front of the array. Default value is 0, or the beginning of the array.
|
||||
* @param {integer} length - Optional restriction on the number of values you want to randomly select from.
|
||||
|
@ -82914,7 +82949,7 @@ Phaser.ArrayUtils = {
|
|||
/**
|
||||
* A standard Fisher-Yates Array shuffle implementation which modifies the array in place.
|
||||
*
|
||||
* @method
|
||||
* @method Phaser.ArrayUtils.shuffle
|
||||
* @param {any[]} array - The array to shuffle.
|
||||
* @return {any[]} The original array, now shuffled.
|
||||
*/
|
||||
|
@ -82935,7 +82970,7 @@ Phaser.ArrayUtils = {
|
|||
/**
|
||||
* Transposes the elements of the given matrix (array of arrays).
|
||||
*
|
||||
* @method
|
||||
* @method Phaser.ArrayUtils.transposeMatrix
|
||||
* @param {Array<any[]>} array - The matrix to transpose.
|
||||
* @return {Array<any[]>} A new transposed matrix
|
||||
*/
|
||||
|
@ -82965,7 +83000,7 @@ Phaser.ArrayUtils = {
|
|||
*
|
||||
* Based on the routine from {@link http://jsfiddle.net/MrPolywhirl/NH42z/}.
|
||||
*
|
||||
* @method
|
||||
* @method Phaser.ArrayUtils.rotateMatrix
|
||||
* @param {Array<any[]>} matrix - The array to rotate; this matrix _may_ be altered.
|
||||
* @param {number|string} direction - The amount to rotate: the rotation in degrees (90, -90, 270, -270, 180) or a string command ('rotateLeft', 'rotateRight' or 'rotate180').
|
||||
* @return {Array<any[]>} The rotated matrix. The source matrix should be discarded for the returned matrix.
|
||||
|
@ -83005,7 +83040,7 @@ Phaser.ArrayUtils = {
|
|||
* Snaps a value to the nearest value in an array.
|
||||
* The result will always be in the range `[first_value, last_value]`.
|
||||
*
|
||||
* @method
|
||||
* @method Phaser.ArrayUtils.findClosest
|
||||
* @param {number} value - The search value
|
||||
* @param {number[]} arr - The input array which _must_ be sorted.
|
||||
* @return {number} The nearest value found.
|
||||
|
@ -83104,7 +83139,7 @@ Phaser.ArrayUtils = {
|
|||
* Create an array representing the inclusive range of numbers (usually integers) in `[start, end]`.
|
||||
* This is equivalent to `numberArrayStep(start, end, 1)`.
|
||||
*
|
||||
* @method Phaser.ArrayUtils#numberArray
|
||||
* @method Phaser.ArrayUtils.numberArray
|
||||
* @param {number} start - The minimum value the array starts with.
|
||||
* @param {number} end - The maximum value the array contains.
|
||||
* @return {number[]} The array of number values.
|
||||
|
@ -83131,7 +83166,7 @@ Phaser.ArrayUtils = {
|
|||
* Certain values for `start` and `end` (eg. NaN/undefined/null) are currently coerced to 0;
|
||||
* for forward compatibility make sure to pass in actual numbers.
|
||||
*
|
||||
* @method Phaser.ArrayUtils#numberArrayStep
|
||||
* @method Phaser.ArrayUtils.numberArrayStep
|
||||
* @param {number} start - The start of the range.
|
||||
* @param {number} [end] - The end of the range.
|
||||
* @param {number} [step=1] - The value to increment or decrement by.
|
||||
|
@ -100480,10 +100515,10 @@ Phaser.Particles.Arcade.Emitter = function (game, x, y, maxParticles) {
|
|||
this.alphaData = null;
|
||||
|
||||
/**
|
||||
* @property {number} gravity - Sets the `body.gravity.y` of each particle sprite to this value on launch.
|
||||
* @property {Phaser.Point} gravity - Sets the `body.gravity` of each particle sprite to this on launch.
|
||||
* @default
|
||||
*/
|
||||
this.gravity = 100;
|
||||
this.gravity = new Phaser.Point(0, 100);
|
||||
|
||||
/**
|
||||
* @property {any} particleClass - For emitting your own particle class types. They must extend Phaser.Particle.
|
||||
|
@ -100841,6 +100876,7 @@ Phaser.Particles.Arcade.Emitter.prototype.explode = function (lifespan, quantity
|
|||
*/
|
||||
Phaser.Particles.Arcade.Emitter.prototype.flow = function (lifespan, frequency, quantity, total, immediate) {
|
||||
|
||||
if (frequency === undefined || frequency === null) { frequency = 250; }
|
||||
if (quantity === undefined || quantity === 0) { quantity = 1; }
|
||||
if (total === undefined) { total = -1; }
|
||||
if (immediate === undefined) { immediate = true; }
|
||||
|
@ -101040,7 +101076,7 @@ Phaser.Particles.Arcade.Emitter.prototype.emitParticle = function (x, y, key, fr
|
|||
body.velocity.y = rnd.between(this.minParticleSpeed.y, this.maxParticleSpeed.y);
|
||||
body.angularVelocity = rnd.between(this.minRotation, this.maxRotation);
|
||||
|
||||
body.gravity.y = this.gravity;
|
||||
body.gravity = this.gravity;
|
||||
body.angularDrag = this.angularDrag;
|
||||
|
||||
particle.onEmit();
|
||||
|
|
File diff suppressed because one or more lines are too long
34
v2-community/build/phaser.min.js
vendored
34
v2-community/build/phaser.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -7,7 +7,7 @@
|
|||
*
|
||||
* Phaser - http://phaser.io
|
||||
*
|
||||
* v2.7.1 "2016-11-28" - Built: Mon Nov 28 2016 18:47:39
|
||||
* v2.7.2 "2016-12-06" - Built: Tue Dec 06 2016 23:48:40
|
||||
*
|
||||
* By Richard Davey http://www.photonstorm.com @photonstorm
|
||||
*
|
||||
|
@ -69,7 +69,7 @@ var PIXI = PIXI || {};
|
|||
*
|
||||
* It is used internally by the likes of PIXI.Sprite.
|
||||
*
|
||||
* @class PIXI.DisplayObject
|
||||
* @class DisplayObject
|
||||
* @constructor
|
||||
*/
|
||||
PIXI.DisplayObject = function () {
|
||||
|
@ -6896,7 +6896,6 @@ PIXI.CanvasRenderer.prototype.mapBlendModes = function () {
|
|||
* A texture stores the information that represents an image. All textures have a base texture.
|
||||
*
|
||||
* @class BaseTexture
|
||||
* @uses EventTarget
|
||||
* @constructor
|
||||
* @param source {String|Canvas} the source object (image or canvas)
|
||||
* @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values
|
||||
|
@ -7164,7 +7163,6 @@ PIXI.TextureSilentFail = false;
|
|||
* to the display list directly. Instead use it as the texture for a PIXI.Sprite. If no frame is provided then the whole image is used.
|
||||
*
|
||||
* @class Texture
|
||||
* @uses EventTarget
|
||||
* @constructor
|
||||
* @param baseTexture {BaseTexture} The base texture source to create the texture from
|
||||
* @param frame {Rectangle} The rectangle frame of the texture to show
|
||||
|
|
File diff suppressed because one or more lines are too long
2
v2-community/build/pixi.min.js
vendored
2
v2-community/build/pixi.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue