mirror of
https://github.com/photonstorm/phaser
synced 2024-11-17 10:18:42 +00:00
Merge branch 'master' of https://github.com/photonstorm/phaser
This commit is contained in:
commit
c1771ecdac
11 changed files with 51 additions and 38 deletions
|
@ -1701,7 +1701,7 @@ var BaseCamera = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* The x position of the center of the Camera's viewport, relative to the top-left of the game canvas.
|
||||
* The horizontal position of the center of the Camera's viewport, relative to the left of the game canvas.
|
||||
*
|
||||
* @name Phaser.Cameras.Scene2D.BaseCamera#centerX
|
||||
* @type {number}
|
||||
|
@ -1718,7 +1718,7 @@ var BaseCamera = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* The y position of the center of the Camera's viewport, relative to the top-left of the game canvas.
|
||||
* The vertical position of the center of the Camera's viewport, relative to the top of the game canvas.
|
||||
*
|
||||
* @name Phaser.Cameras.Scene2D.BaseCamera#centerY
|
||||
* @type {number}
|
||||
|
|
|
@ -28,7 +28,7 @@ var Sprite = require('../sprite/Sprite');
|
|||
/**
|
||||
* @typedef {object} GroupConfig
|
||||
*
|
||||
* @property {?object} [classType=Sprite] - Sets {@link Phaser.GameObjects.Group#classType}.
|
||||
* @property {?GroupClassTypeConstructor} [classType=Sprite] - Sets {@link Phaser.GameObjects.Group#classType}.
|
||||
* @property {?boolean} [active=true] - Sets {@link Phaser.GameObjects.Group#active}.
|
||||
* @property {?number} [maxSize=-1] - Sets {@link Phaser.GameObjects.Group#maxSize}.
|
||||
* @property {?string} [defaultKey=null] - Sets {@link Phaser.GameObjects.Group#defaultKey}.
|
||||
|
@ -52,7 +52,7 @@ var Sprite = require('../sprite/Sprite');
|
|||
*
|
||||
* `key` is required. {@link Phaser.GameObjects.Group#defaultKey} is not used.
|
||||
*
|
||||
* @property {?object} [classType] - The class of each new Game Object.
|
||||
* @property {?GroupClassTypeConstructor} [classType] - The class of each new Game Object.
|
||||
* @property {string} [key] - The texture key of each new Game Object.
|
||||
* @property {?(string|integer)} [frame=null] - The texture frame of each new Game Object.
|
||||
* @property {?boolean} [visible=true] - The visible state of each new Game Object.
|
||||
|
@ -93,6 +93,18 @@ var Sprite = require('../sprite/Sprite');
|
|||
* @see Phaser.Utils.Array.Range
|
||||
*/
|
||||
|
||||
/**
|
||||
* A constructor function (class) that can be assigned to `classType`.
|
||||
* @callback GroupClassTypeConstructor
|
||||
* @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time.
|
||||
* @param {number} x - The horizontal position of this Game Object in the world.
|
||||
* @param {number} y - The vertical position of this Game Object in the world.
|
||||
* @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.
|
||||
* @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with.
|
||||
*
|
||||
* @see Phaser.GameObjects.Group#classType
|
||||
*/
|
||||
|
||||
/**
|
||||
* @classdesc A Group is a way for you to create, manipulate, or recycle similar Game Objects.
|
||||
*
|
||||
|
@ -185,7 +197,7 @@ var Group = new Class({
|
|||
* The class to create new group members from.
|
||||
*
|
||||
* @name Phaser.GameObjects.Group#classType
|
||||
* @type {object}
|
||||
* @type {GroupClassTypeConstructor}
|
||||
* @since 3.0.0
|
||||
* @default Phaser.GameObjects.Sprite
|
||||
*/
|
||||
|
|
|
@ -10,12 +10,10 @@ var Image = require('../../gameobjects/image/Image');
|
|||
|
||||
/**
|
||||
* @classdesc
|
||||
* An Arcade Physics Image Game Object.
|
||||
* An Arcade Physics Image is an Image with an Arcade Physics body and related components.
|
||||
* The body can be dynamic or static.
|
||||
*
|
||||
* An Image is a light-weight Game Object useful for the display of static images in your game,
|
||||
* such as logos, backgrounds, scenery or other non-animated elements. Images can have input
|
||||
* events and physics bodies, or be tweened, tinted or scrolled. The main difference between an
|
||||
* Image and a Sprite is that you cannot animate an Image as they do not have the Animation component.
|
||||
* The main difference between an Arcade Image and an Arcade Sprite is that you cannot animate an Arcade Image.
|
||||
*
|
||||
* @class Image
|
||||
* @extends Phaser.GameObjects.Image
|
||||
|
|
|
@ -10,15 +10,11 @@ var Sprite = require('../../gameobjects/sprite/Sprite');
|
|||
|
||||
/**
|
||||
* @classdesc
|
||||
* An Arcade Physics Sprite Game Object.
|
||||
* An Arcade Physics Sprite is a Sprite with an Arcade Physics body and related components.
|
||||
* The body can be dynamic or static.
|
||||
*
|
||||
* A Sprite Game Object is used for the display of both static and animated images in your game.
|
||||
* Sprites can have input events and physics bodies. They can also be tweened, tinted, scrolled
|
||||
* and animated.
|
||||
*
|
||||
* The main difference between a Sprite and an Image Game Object is that you cannot animate Images.
|
||||
* As such, Sprites take a fraction longer to process and have a larger API footprint due to the Animation
|
||||
* Component. If you do not require animation then you can safely use Images to replace Sprites in all cases.
|
||||
* The main difference between an Arcade Sprite and an Arcade Image is that you cannot animate an Arcade Image.
|
||||
* If you do not require animation then you can safely use Arcade Images instead of Arcade Sprites.
|
||||
*
|
||||
* @class Sprite
|
||||
* @extends Phaser.GameObjects.Sprite
|
||||
|
|
|
@ -623,7 +623,7 @@ var Body = new Class({
|
|||
this.overlapR = 0;
|
||||
|
||||
/**
|
||||
* Whether this Body is overlapped with another and both have zero velocity.
|
||||
* Whether this Body is overlapped with another and both are not moving.
|
||||
*
|
||||
* @name Phaser.Physics.Arcade.Body#embedded
|
||||
* @type {boolean}
|
||||
|
@ -718,6 +718,7 @@ var Body = new Class({
|
|||
* @name Phaser.Physics.Arcade.Body#physicsType
|
||||
* @type {integer}
|
||||
* @readonly
|
||||
* @default Phaser.Physics.Arcade.DYNAMIC_BODY
|
||||
* @since 3.0.0
|
||||
*/
|
||||
this.physicsType = CONST.DYNAMIC_BODY;
|
||||
|
@ -787,7 +788,8 @@ var Body = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* Updates this Body's transform, dimensions, and position from its Game Object.
|
||||
* Updates the Body's `transform`, `width`, `height`, and `center` from its Game Object.
|
||||
* The Body's `position` isn't changed.
|
||||
*
|
||||
* @method Phaser.Physics.Arcade.Body#updateBounds
|
||||
* @since 3.0.0
|
||||
|
@ -874,7 +876,7 @@ var Body = new Class({
|
|||
* @fires Phaser.Physics.Arcade.World#worldbounds
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {number} delta - The delta time, in ms, elapsed since the last frame.
|
||||
* @param {number} delta - The delta time, in seconds, elapsed since the last frame.
|
||||
*/
|
||||
update: function (delta)
|
||||
{
|
||||
|
|
|
@ -40,7 +40,7 @@ var Collider = new Class({
|
|||
this.world = world;
|
||||
|
||||
/**
|
||||
* The name of the collider (unused by phaser).
|
||||
* The name of the collider (unused by Phaser).
|
||||
*
|
||||
* @name Phaser.Physics.Arcade.Collider#name
|
||||
* @type {string}
|
||||
|
|
|
@ -58,7 +58,7 @@ var Factory = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* Create a new Arcade Physics Collider object.
|
||||
* Creates a new Arcade Physics Collider object.
|
||||
*
|
||||
* @method Phaser.Physics.Arcade.Factory#collider
|
||||
* @since 3.0.0
|
||||
|
@ -77,7 +77,7 @@ var Factory = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* Create a new Arcade Physics Collider Overlap object.
|
||||
* Creates a new Arcade Physics Collider Overlap object.
|
||||
*
|
||||
* @method Phaser.Physics.Arcade.Factory#overlap
|
||||
* @since 3.0.0
|
||||
|
|
|
@ -154,7 +154,7 @@ var PhysicsGroup = new Class({
|
|||
*
|
||||
* @name Phaser.Physics.Arcade.Group#physicsType
|
||||
* @type {integer}
|
||||
* @default DYNAMIC_BODY
|
||||
* @default Phaser.Physics.Arcade.DYNAMIC_BODY
|
||||
* @since 3.0.0
|
||||
*/
|
||||
this.physicsType = CONST.DYNAMIC_BODY;
|
||||
|
|
|
@ -219,10 +219,12 @@ var StaticBody = new Class({
|
|||
// If true this Body will dispatch events
|
||||
|
||||
/**
|
||||
* Whether the simulation emits a `worldbounds` event when this StaticBody collides with the world boundary (and `collideWorldBounds` is also true).
|
||||
* Whether the simulation emits a `worldbounds` event when this StaticBody collides with the world boundary.
|
||||
* Always false for a Static Body. (Static Bodies never collide with the world boundary and never trigger a `worldbounds` event.)
|
||||
*
|
||||
* @name Phaser.Physics.Arcade.StaticBody#onWorldBounds
|
||||
* @type {boolean}
|
||||
* @readonly
|
||||
* @default false
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
@ -269,7 +271,7 @@ var StaticBody = new Class({
|
|||
this.immovable = true;
|
||||
|
||||
/**
|
||||
* A flag disabling the default horizontal separation of colliding bodies. Pass your own `processHandler` to the collider.
|
||||
* A flag disabling the default horizontal separation of colliding bodies. Pass your own `collideHandler` to the collider.
|
||||
*
|
||||
* @name Phaser.Physics.Arcade.StaticBody#customSeparateX
|
||||
* @type {boolean}
|
||||
|
@ -279,7 +281,7 @@ var StaticBody = new Class({
|
|||
this.customSeparateX = false;
|
||||
|
||||
/**
|
||||
* A flag disabling the default vertical separation of colliding bodies. Pass your own `processHandler` to the collider.
|
||||
* A flag disabling the default vertical separation of colliding bodies. Pass your own `collideHandler` to the collider.
|
||||
*
|
||||
* @name Phaser.Physics.Arcade.StaticBody#customSeparateY
|
||||
* @type {boolean}
|
||||
|
@ -319,7 +321,7 @@ var StaticBody = new Class({
|
|||
this.overlapR = 0;
|
||||
|
||||
/**
|
||||
* Whether this StaticBody is overlapped with another and both have zero velocity.
|
||||
* Whether this StaticBody has ever overlapped with another while both were not moving.
|
||||
*
|
||||
* @name Phaser.Physics.Arcade.StaticBody#embedded
|
||||
* @type {boolean}
|
||||
|
@ -330,9 +332,11 @@ var StaticBody = new Class({
|
|||
|
||||
/**
|
||||
* Whether this StaticBody interacts with the world boundary.
|
||||
* Always false for a Static Body. (Static Bodies never collide with the world boundary.)
|
||||
*
|
||||
* @name Phaser.Physics.Arcade.StaticBody#collideWorldBounds
|
||||
* @type {boolean}
|
||||
* @readonly
|
||||
* @default false
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
@ -348,7 +352,7 @@ var StaticBody = new Class({
|
|||
this.checkCollision = { none: false, up: true, down: true, left: true, right: true };
|
||||
|
||||
/**
|
||||
* Whether this StaticBody is colliding with another and in which direction.
|
||||
* Whether this StaticBody has ever collided with another body and in which direction.
|
||||
*
|
||||
* @name Phaser.Physics.Arcade.StaticBody#touching
|
||||
* @type {ArcadeBodyCollision}
|
||||
|
@ -357,7 +361,7 @@ var StaticBody = new Class({
|
|||
this.touching = { none: true, up: false, down: false, left: false, right: false };
|
||||
|
||||
/**
|
||||
* Whether this StaticBody was colliding with another during the last step, and in which direction.
|
||||
* Whether this StaticBody was colliding with another body during the last step or any previous step, and in which direction.
|
||||
*
|
||||
* @name Phaser.Physics.Arcade.StaticBody#wasTouching
|
||||
* @type {ArcadeBodyCollision}
|
||||
|
@ -366,7 +370,7 @@ var StaticBody = new Class({
|
|||
this.wasTouching = { none: true, up: false, down: false, left: false, right: false };
|
||||
|
||||
/**
|
||||
* Whether this StaticBody is colliding with a tile or the world boundary.
|
||||
* Whether this StaticBody has ever collided with a tile or the world boundary.
|
||||
*
|
||||
* @name Phaser.Physics.Arcade.StaticBody#blocked
|
||||
* @type {ArcadeBodyCollision}
|
||||
|
@ -379,6 +383,7 @@ var StaticBody = new Class({
|
|||
*
|
||||
* @name Phaser.Physics.Arcade.StaticBody#physicsType
|
||||
* @type {integer}
|
||||
* @default Phaser.Physics.Arcade.STATIC_BODY
|
||||
* @since 3.0.0
|
||||
*/
|
||||
this.physicsType = CONST.STATIC_BODY;
|
||||
|
|
|
@ -86,7 +86,7 @@ var StaticPhysicsGroup = new Class({
|
|||
*
|
||||
* @name Phaser.Physics.Arcade.StaticGroup#physicsType
|
||||
* @type {integer}
|
||||
* @default STATIC_BODY
|
||||
* @default Phaser.Physics.Arcade.STATIC_BODY
|
||||
* @since 3.0.0
|
||||
*/
|
||||
this.physicsType = CONST.STATIC_BODY;
|
||||
|
|
|
@ -1057,12 +1057,12 @@ var World = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* Advances the simulation by one step.
|
||||
* Advances the simulation by a time increment.
|
||||
*
|
||||
* @method Phaser.Physics.Arcade.World#step
|
||||
* @since 3.10.0
|
||||
*
|
||||
* @param {number} delta - The delta time amount, in ms, by which to advance the simulation.
|
||||
* @param {number} delta - The delta time amount, in seconds, by which to advance the simulation.
|
||||
*/
|
||||
step: function (delta)
|
||||
{
|
||||
|
@ -1201,7 +1201,7 @@ var World = new Class({
|
|||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.Physics.Arcade.Body} body - The Body to be updated.
|
||||
* @param {number} delta - The delta value to be used in the motion calculations.
|
||||
* @param {number} delta - The delta value to be used in the motion calculations, in seconds.
|
||||
*/
|
||||
updateMotion: function (body, delta)
|
||||
{
|
||||
|
@ -1220,7 +1220,7 @@ var World = new Class({
|
|||
* @since 3.10.0
|
||||
*
|
||||
* @param {Phaser.Physics.Arcade.Body} body - The Body to compute the velocity for.
|
||||
* @param {number} delta - The delta value to be used in the calculation.
|
||||
* @param {number} delta - The delta value to be used in the calculation, in seconds.
|
||||
*/
|
||||
computeAngularVelocity: function (body, delta)
|
||||
{
|
||||
|
@ -1266,7 +1266,7 @@ var World = new Class({
|
|||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.Physics.Arcade.Body} body - The Body to compute the velocity for.
|
||||
* @param {number} delta - The delta value to be used in the calculation.
|
||||
* @param {number} delta - The delta value to be used in the calculation, in seconds.
|
||||
*/
|
||||
computeVelocity: function (body, delta)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue