mirror of
https://github.com/photonstorm/phaser
synced 2024-11-22 04:33:31 +00:00
Added new jsdocs
This commit is contained in:
parent
be5b325fa1
commit
c237209bb8
24 changed files with 306 additions and 281 deletions
10
CHANGELOG.md
10
CHANGELOG.md
|
@ -92,10 +92,20 @@ snowbillr
|
|||
Stephen Hamilton
|
||||
STuFF
|
||||
TadejZupancic
|
||||
|
||||
ajmetal
|
||||
henriacle
|
||||
@rgk
|
||||
@samme
|
||||
Carl
|
||||
@16patsle
|
||||
Kyle
|
||||
Hardylr
|
||||
andiCR
|
||||
@bobonthenet
|
||||
Kanthi
|
||||
|
||||
|
||||
|
||||
## Version 3.13.0 - Yuuki - 20th September 2018
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Provides methods used for setting the acceleration properties of an Arcade Body.
|
||||
*
|
||||
* @name Phaser.Physics.Arcade.Components.Acceleration
|
||||
* @since 3.0.0
|
||||
|
@ -13,7 +13,7 @@
|
|||
var Acceleration = {
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Sets the body's horizontal and vertical acceleration. If the vertical acceleration value is not provided, the vertical acceleration is set to the same value as the horizontal acceleration.
|
||||
*
|
||||
* @method Phaser.Physics.Arcade.Components.Acceleration#setAcceleration
|
||||
* @since 3.0.0
|
||||
|
@ -31,7 +31,7 @@ var Acceleration = {
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Sets the body's horizontal acceleration.
|
||||
*
|
||||
* @method Phaser.Physics.Arcade.Components.Acceleration#setAccelerationX
|
||||
* @since 3.0.0
|
||||
|
@ -48,7 +48,7 @@ var Acceleration = {
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Sets the body's vertical acceleration.
|
||||
*
|
||||
* @method Phaser.Physics.Arcade.Components.Acceleration#setAccelerationY
|
||||
* @since 3.0.0
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Sets the friction (e.g. the amount of velocity reduced over time) of the physics body when moving horizontally in the X axis. The higher than friction, the faster the body will slow down once force stops being applied to it.
|
||||
*
|
||||
* @name Phaser.Physics.Arcade.Components.Friction
|
||||
* @since 3.0.0
|
||||
|
@ -13,13 +13,14 @@
|
|||
var Friction = {
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Sets the friction (e.g. the amount of velocity reduced over time) of the physics body when moving.
|
||||
* The higher than friction, the faster the body will slow down once force stops being applied to it.
|
||||
*
|
||||
* @method Phaser.Physics.Arcade.Components.Friction#setFriction
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {number} x - [description]
|
||||
* @param {number} [y=x] - [description]
|
||||
* @param {number} x - The amount of horizontal friction to apply.
|
||||
* @param {number} [y=x] - The amount of vertical friction to apply.
|
||||
*
|
||||
* @return {this} This Game Object.
|
||||
*/
|
||||
|
@ -31,12 +32,13 @@ var Friction = {
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Sets the friction (e.g. the amount of velocity reduced over time) of the physics body when moving horizontally in the X axis.
|
||||
* The higher than friction, the faster the body will slow down once force stops being applied to it.
|
||||
*
|
||||
* @method Phaser.Physics.Arcade.Components.Friction#setFrictionX
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {number} x - [description]
|
||||
* @param {number} x - The amount of friction to apply.
|
||||
*
|
||||
* @return {this} This Game Object.
|
||||
*/
|
||||
|
@ -48,12 +50,13 @@ var Friction = {
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Sets the friction (e.g. the amount of velocity reduced over time) of the physics body when moving vertically in the Y axis.
|
||||
* The higher than friction, the faster the body will slow down once force stops being applied to it.
|
||||
*
|
||||
* @method Phaser.Physics.Arcade.Components.Friction#setFrictionY
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {number} y - [description]
|
||||
* @param {number} x - The amount of friction to apply.
|
||||
*
|
||||
* @return {this} This Game Object.
|
||||
*/
|
||||
|
|
|
@ -5,7 +5,8 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Provides methods for setting the gravity properties of an Arcade Physics Game Object.
|
||||
* Should be applied as a mixin and not used directly.
|
||||
*
|
||||
* @name Phaser.Physics.Arcade.Components.Gravity
|
||||
* @since 3.0.0
|
||||
|
@ -13,13 +14,15 @@
|
|||
var Gravity = {
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Set the X and Y values of the gravitational pull to act upon this Arcade Physics Game Object. Values can be positive or negative. Larger values result in a stronger effect.
|
||||
*
|
||||
* If only one value is provided, this value will be used for both the X and Y axis.
|
||||
*
|
||||
* @method Phaser.Physics.Arcade.Components.Gravity#setGravity
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {number} x - [description]
|
||||
* @param {number} [y=x] - [description]
|
||||
* @param {number} x - The gravitational force to be applied to the X-axis.
|
||||
* @param {number} [y=x] - The gravitational force to be applied to the Y-axis. If this is not specified, the X value will be used.
|
||||
*
|
||||
* @return {this} This Game Object.
|
||||
*/
|
||||
|
@ -31,12 +34,12 @@ var Gravity = {
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Set the gravitational force to be applied to the X axis. Value can be positive or negative. Larger values result in a stronger effect.
|
||||
*
|
||||
* @method Phaser.Physics.Arcade.Components.Gravity#setGravityX
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {number} x - [description]
|
||||
* @param {number} x - The gravitational force to be applied to the X-axis.
|
||||
*
|
||||
* @return {this} This Game Object.
|
||||
*/
|
||||
|
@ -48,12 +51,12 @@ var Gravity = {
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Set the gravitational force to be applied to the Y axis. Value can be positive or negative. Larger values result in a stronger effect.
|
||||
*
|
||||
* @method Phaser.Physics.Arcade.Components.Gravity#setGravityY
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {number} y - [description]
|
||||
* @param {number} y - The gravitational force to be applied to the Y-axis.
|
||||
*
|
||||
* @return {this} This Game Object.
|
||||
*/
|
||||
|
|
|
@ -5,7 +5,8 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Provides methods for setting the size of an Arcade Physics Game Object.
|
||||
* Should be applied as a mixin and not used directly.
|
||||
*
|
||||
* @name Phaser.Physics.Arcade.Components.Size
|
||||
* @since 3.0.0
|
||||
|
@ -13,13 +14,14 @@
|
|||
var Size = {
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Sets the body offset. This allows you to adjust the difference between the center of the body
|
||||
* and the x and y coordinates of the parent Game Object.
|
||||
*
|
||||
* @method Phaser.Physics.Arcade.Components.Size#setOffset
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {number} x - [description]
|
||||
* @param {number} [y=x] - [description]
|
||||
* @param {number} x - The amount to offset the body from the parent Game Object along the x-axis.
|
||||
* @param {number} [y=x] - The amount to offset the body from the parent Game Object along the y-axis. Defaults to the value given for the x-axis.
|
||||
*
|
||||
* @return {this} This Game Object.
|
||||
*/
|
||||
|
@ -31,14 +33,15 @@ var Size = {
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Sets the size of this physics body. Setting the size does not adjust the dimensions
|
||||
* of the parent Game Object.
|
||||
*
|
||||
* @method Phaser.Physics.Arcade.Components.Size#setSize
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {number} width - [description]
|
||||
* @param {number} height - [description]
|
||||
* @param {boolean} [center=true] - [description]
|
||||
* @param {number} width - The new width of the physics body, in pixels.
|
||||
* @param {number} height - The new height of the physics body, in pixels.
|
||||
* @param {boolean} [center=true] - Should the body be re-positioned so its center aligns with the parent Game Object?
|
||||
*
|
||||
* @return {this} This Game Object.
|
||||
*/
|
||||
|
@ -50,14 +53,14 @@ var Size = {
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Sets this physics body to use a circle for collision instead of a rectangle.
|
||||
*
|
||||
* @method Phaser.Physics.Arcade.Components.Size#setCircle
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {number} radius - [description]
|
||||
* @param {number} [offsetX] - [description]
|
||||
* @param {number} [offsetY] - [description]
|
||||
* @param {number} radius - The radius of the physics body, in pixels.
|
||||
* @param {number} [offsetX] - The amount to offset the body from the parent Game Object along the x-axis.
|
||||
* @param {number} [offsetY] - The amount to offset the body from the parent Game Object along the y-axis.
|
||||
*
|
||||
* @return {this} This Game Object.
|
||||
*/
|
||||
|
|
|
@ -481,15 +481,15 @@ var Body = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Reset the size and position of the physics body.
|
||||
*
|
||||
* @method Phaser.Physics.Impact.Body#resetSize
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {number} x - [description]
|
||||
* @param {number} y - [description]
|
||||
* @param {number} width - [description]
|
||||
* @param {number} height - [description]
|
||||
* @param {number} x - The x coordinate to position the body.
|
||||
* @param {number} y - The y coordinate to position the body.
|
||||
* @param {number} width - The width of the body.
|
||||
* @param {number} height - The height of the body.
|
||||
*
|
||||
* @return {Phaser.Physics.Impact.Body} This Body object.
|
||||
*/
|
||||
|
|
|
@ -19,7 +19,7 @@ var ImpactSprite = require('./ImpactSprite');
|
|||
* @constructor
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.Physics.Impact.World} world - [description]
|
||||
* @param {Phaser.Physics.Impact.World} world - A reference to the Impact Physics world.
|
||||
*/
|
||||
var Factory = new Class({
|
||||
|
||||
|
@ -28,7 +28,7 @@ var Factory = new Class({
|
|||
function Factory (world)
|
||||
{
|
||||
/**
|
||||
* [description]
|
||||
* A reference to the Impact Physics world.
|
||||
*
|
||||
* @name Phaser.Physics.Impact.Factory#world
|
||||
* @type {Phaser.Physics.Impact.World}
|
||||
|
@ -47,15 +47,15 @@ var Factory = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Creates a new ImpactBody object and adds it to the physics simulation.
|
||||
*
|
||||
* @method Phaser.Physics.Impact.Factory#body
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {number} x - [description]
|
||||
* @param {number} y - [description]
|
||||
* @param {number} width - [description]
|
||||
* @param {number} height - [description]
|
||||
* @param {number} x - The horizontal position of the body in the physics world.
|
||||
* @param {number} y - The vertical position of the body in the physics world.
|
||||
* @param {number} width - The width of the body.
|
||||
* @param {number} height - The height of the body.
|
||||
*
|
||||
* @return {Phaser.Physics.Impact.ImpactBody} The ImpactBody object that was created.
|
||||
*/
|
||||
|
@ -70,7 +70,7 @@ var Factory = new Class({
|
|||
* @method Phaser.Physics.Impact.Factory#existing
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.GameObjects.GameObject} gameObject - [description]
|
||||
* @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to receive the physics body.
|
||||
*
|
||||
* @return {Phaser.GameObjects.GameObject} The Game Object.
|
||||
*/
|
||||
|
@ -90,7 +90,7 @@ var Factory = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Creates a new ImpactImage object and adds it to the physics world.
|
||||
*
|
||||
* @method Phaser.Physics.Impact.Factory#image
|
||||
* @since 3.0.0
|
||||
|
@ -112,7 +112,7 @@ var Factory = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Creates a new ImpactSprite object and adds it to the physics world.
|
||||
*
|
||||
* @method Phaser.Physics.Impact.Factory#sprite
|
||||
* @since 3.0.0
|
||||
|
|
|
@ -19,31 +19,31 @@ var TYPE = require('./TYPE');
|
|||
/**
|
||||
* @typedef {object} Phaser.Physics.Impact.WorldConfig
|
||||
*
|
||||
* @property {number} [gravity=0] - [description]
|
||||
* @property {number} [cellSize=64] - [description]
|
||||
* @property {number} [timeScale=1] - [description]
|
||||
* @property {number} [gravity=0] - Sets {@link Phaser.Physics.Impact.World#gravity}
|
||||
* @property {number} [cellSize=64] - The size of the cells used for the broadphase pass. Increase this value if you have lots of large objects in the world.
|
||||
* @property {number} [timeScale=1] - A `Number` that allows per-body time scaling, e.g. a force-field where bodies inside are in slow-motion, while others are at full speed.
|
||||
* @property {number} [maxStep=0.05] - [description]
|
||||
* @property {boolean} [debug=false] - [description]
|
||||
* @property {number} [maxVelocity=100] - [description]
|
||||
* @property {boolean} [debugShowBody=true] - [description]
|
||||
* @property {boolean} [debugShowVelocity=true] - [description]
|
||||
* @property {number} [debugBodyColor=0xff00ff] - [description]
|
||||
* @property {number} [debugVelocityColor=0x00ff00] - [description]
|
||||
* @property {number} [maxVelocityX=maxVelocity] - [description]
|
||||
* @property {number} [maxVelocityY=maxVelocity] - [description]
|
||||
* @property {number} [minBounceVelocity=40] - [description]
|
||||
* @property {number} [gravityFactor=1] - [description]
|
||||
* @property {number} [bounciness=0] - [description]
|
||||
* @property {(object|boolean)} [setBounds] - [description]
|
||||
* @property {number} [setBounds.x=0] - [description]
|
||||
* @property {number} [setBounds.y=0] - [description]
|
||||
* @property {number} [setBounds.width] - [description]
|
||||
* @property {number} [setBounds.height] - [description]
|
||||
* @property {number} [setBounds.thickness=64] - [description]
|
||||
* @property {boolean} [setBounds.left=true] - [description]
|
||||
* @property {boolean} [setBounds.right=true] - [description]
|
||||
* @property {boolean} [setBounds.top=true] - [description]
|
||||
* @property {boolean} [setBounds.bottom=true] - [description]
|
||||
* @property {boolean} [debug=false] - Sets {@link Phaser.Physics.Impact.World#debug}.
|
||||
* @property {number} [maxVelocity=100] - The maximum velocity a body can move.
|
||||
* @property {boolean} [debugShowBody=true] - Whether the Body's boundary is drawn to the debug display.
|
||||
* @property {boolean} [debugShowVelocity=true] - Whether the Body's velocity is drawn to the debug display.
|
||||
* @property {number} [debugBodyColor=0xff00ff] - The color of this Body on the debug display.
|
||||
* @property {number} [debugVelocityColor=0x00ff00] - The color of the Body's velocity on the debug display.
|
||||
* @property {number} [maxVelocityX=maxVelocity] - Maximum X velocity objects can move.
|
||||
* @property {number} [maxVelocityY=maxVelocity] - Maximum Y velocity objects can move.
|
||||
* @property {number} [minBounceVelocity=40] - The minimum velocity an object can be moving at to be considered for bounce.
|
||||
* @property {number} [gravityFactor=1] - Gravity multiplier. Set to 0 for no gravity.
|
||||
* @property {number} [bounciness=0] - The default bounce, or restitution, of bodies in the world.
|
||||
* @property {(object|boolean)} [setBounds] - Should the world have bounds enabled by default?
|
||||
* @property {number} [setBounds.x=0] - The x coordinate of the world bounds.
|
||||
* @property {number} [setBounds.y=0] - The y coordinate of the world bounds.
|
||||
* @property {number} [setBounds.width] - The width of the world bounds.
|
||||
* @property {number} [setBounds.height] - The height of the world bounds.
|
||||
* @property {number} [setBounds.thickness=64] - The thickness of the walls of the world bounds.
|
||||
* @property {boolean} [setBounds.left=true] - Should the left-side world bounds wall be created?
|
||||
* @property {boolean} [setBounds.right=true] - Should the right-side world bounds wall be created?
|
||||
* @property {boolean} [setBounds.top=true] - Should the top world bounds wall be created?
|
||||
* @property {boolean} [setBounds.bottom=true] - Should the bottom world bounds wall be created?
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -51,24 +51,24 @@ var TYPE = require('./TYPE');
|
|||
*
|
||||
* @typedef {object} Phaser.Physics.Impact.WorldDefaults
|
||||
*
|
||||
* @property {boolean} debugShowBody - [description]
|
||||
* @property {boolean} debugShowVelocity - [description]
|
||||
* @property {number} bodyDebugColor - [description]
|
||||
* @property {number} velocityDebugColor - [description]
|
||||
* @property {number} maxVelocityX - [description]
|
||||
* @property {number} maxVelocityY - [description]
|
||||
* @property {number} minBounceVelocity - [description]
|
||||
* @property {number} gravityFactor - [description]
|
||||
* @property {number} bounciness - [description]
|
||||
* @property {boolean} debugShowBody - Whether the Body's boundary is drawn to the debug display.
|
||||
* @property {boolean} debugShowVelocity - Whether the Body's velocity is drawn to the debug display.
|
||||
* @property {number} bodyDebugColor - The color of this Body on the debug display.
|
||||
* @property {number} velocityDebugColor - The color of the Body's velocity on the debug display.
|
||||
* @property {number} maxVelocityX - Maximum X velocity objects can move.
|
||||
* @property {number} maxVelocityY - Maximum Y velocity objects can move.
|
||||
* @property {number} minBounceVelocity - The minimum velocity an object can be moving at to be considered for bounce.
|
||||
* @property {number} gravityFactor - Gravity multiplier. Set to 0 for no gravity.
|
||||
* @property {number} bounciness - The default bounce, or restitution, of bodies in the world.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {object} Phaser.Physics.Impact.WorldWalls
|
||||
*
|
||||
* @property {?Phaser.Physics.Impact.Body} left - [description]
|
||||
* @property {?Phaser.Physics.Impact.Body} right - [description]
|
||||
* @property {?Phaser.Physics.Impact.Body} top - [description]
|
||||
* @property {?Phaser.Physics.Impact.Body} bottom - [description]
|
||||
* @property {?Phaser.Physics.Impact.Body} left - The left-side wall of the world bounds.
|
||||
* @property {?Phaser.Physics.Impact.Body} right - The right-side wall of the world bounds.
|
||||
* @property {?Phaser.Physics.Impact.Body} top - The top wall of the world bounds.
|
||||
* @property {?Phaser.Physics.Impact.Body} bottom - The bottom wall of the world bounds.
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -484,12 +484,12 @@ var World = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Creates a Graphics Game Object used for debug display and enables the world for debug drawing.
|
||||
*
|
||||
* @method Phaser.Physics.Impact.World#createDebugGraphic
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @return {Phaser.GameObjects.Graphics} [description]
|
||||
* @return {Phaser.GameObjects.Graphics} The Graphics object created that will have the debug visuals drawn to it.
|
||||
*/
|
||||
createDebugGraphic: function ()
|
||||
{
|
||||
|
|
|
@ -5,7 +5,8 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* The Impact Acceleration component.
|
||||
* Should be applied as a mixin.
|
||||
*
|
||||
* @name Phaser.Physics.Impact.Components.Acceleration
|
||||
* @since 3.0.0
|
||||
|
@ -13,14 +14,14 @@
|
|||
var Acceleration = {
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Sets the horizontal acceleration of this body.
|
||||
*
|
||||
* @method Phaser.Physics.Impact.Components.Acceleration#setAccelerationX
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {number} x - [description]
|
||||
* @param {number} x - The amount of acceleration to apply.
|
||||
*
|
||||
* @return {Phaser.GameObjects.GameObject} This Game Object.
|
||||
* @return {this} This Game Object.
|
||||
*/
|
||||
setAccelerationX: function (x)
|
||||
{
|
||||
|
@ -30,14 +31,14 @@ var Acceleration = {
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Sets the vertical acceleration of this body.
|
||||
*
|
||||
* @method Phaser.Physics.Impact.Components.Acceleration#setAccelerationY
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {number} y - [description]
|
||||
* @param {number} y - The amount of acceleration to apply.
|
||||
*
|
||||
* @return {Phaser.GameObjects.GameObject} This Game Object.
|
||||
* @return {this} This Game Object.
|
||||
*/
|
||||
setAccelerationY: function (y)
|
||||
{
|
||||
|
@ -47,15 +48,15 @@ var Acceleration = {
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Sets the horizontal and vertical acceleration of this body.
|
||||
*
|
||||
* @method Phaser.Physics.Impact.Components.Acceleration#setAcceleration
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {number} x - [description]
|
||||
* @param {number} y - [description]
|
||||
* @param {number} x - The amount of horizontal acceleration to apply.
|
||||
* @param {number} y - The amount of vertical acceleration to apply.
|
||||
*
|
||||
* @return {Phaser.GameObjects.GameObject} This Game Object.
|
||||
* @return {this} This Game Object.
|
||||
*/
|
||||
setAcceleration: function (x, y)
|
||||
{
|
||||
|
|
|
@ -5,7 +5,8 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* The Impact Body Scale component.
|
||||
* Should be applied as a mixin.
|
||||
*
|
||||
* @name Phaser.Physics.Impact.Components.BodyScale
|
||||
* @since 3.0.0
|
||||
|
@ -13,15 +14,15 @@
|
|||
var BodyScale = {
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Sets the size of the physics body.
|
||||
*
|
||||
* @method Phaser.Physics.Impact.Components.BodyScale#setBodySize
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {number} width - [description]
|
||||
* @param {number} [height=width] - [description]
|
||||
* @param {number} width - The width of the body in pixels.
|
||||
* @param {number} [height=width] - The height of the body in pixels.
|
||||
*
|
||||
* @return {Phaser.GameObjects.GameObject} This Game Object.
|
||||
* @return {this} This Game Object.
|
||||
*/
|
||||
setBodySize: function (width, height)
|
||||
{
|
||||
|
@ -34,15 +35,15 @@ var BodyScale = {
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Sets the scale of the physics body.
|
||||
*
|
||||
* @method Phaser.Physics.Impact.Components.BodyScale#setBodyScale
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {number} scaleX - [description]
|
||||
* @param {number} [scaleY] - [description]
|
||||
* @param {number} scaleX - The horizontal scale of the body.
|
||||
* @param {number} [scaleY] - The vertical scale of the body. If not given, will use the horizontal scale value.
|
||||
*
|
||||
* @return {Phaser.GameObjects.GameObject} This Game Object.
|
||||
* @return {this} This Game Object.
|
||||
*/
|
||||
setBodyScale: function (scaleX, scaleY)
|
||||
{
|
||||
|
|
|
@ -7,7 +7,8 @@
|
|||
var TYPE = require('../TYPE');
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* The Impact Body Type component.
|
||||
* Should be applied as a mixin.
|
||||
*
|
||||
* @name Phaser.Physics.Impact.Components.BodyType
|
||||
* @since 3.0.0
|
||||
|
|
|
@ -5,7 +5,8 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* The Impact Bounce component.
|
||||
* Should be applied as a mixin.
|
||||
*
|
||||
* @name Phaser.Physics.Impact.Components.Bounce
|
||||
* @since 3.0.0
|
||||
|
@ -13,12 +14,12 @@
|
|||
var Bounce = {
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Sets the impact physics bounce, or restitution, value.
|
||||
*
|
||||
* @method Phaser.Physics.Impact.Components.Bounce#setBounce
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {number} value - [description]
|
||||
* @param {number} value - A value between 0 (no rebound) and 1 (full rebound)
|
||||
*
|
||||
* @return {Phaser.GameObjects.GameObject} This Game Object.
|
||||
*/
|
||||
|
@ -30,12 +31,12 @@ var Bounce = {
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Sets the minimum velocity the body is allowed to be moving to be considered for rebound.
|
||||
*
|
||||
* @method Phaser.Physics.Impact.Components.Bounce#setMinBounceVelocity
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {number} value - [description]
|
||||
* @param {number} value - The minimum allowed velocity.
|
||||
*
|
||||
* @return {Phaser.GameObjects.GameObject} This Game Object.
|
||||
*/
|
||||
|
@ -47,7 +48,8 @@ var Bounce = {
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* The bounce, or restitution, value of this body.
|
||||
* A value between 0 (no rebound) and 1 (full rebound)
|
||||
*
|
||||
* @name Phaser.Physics.Impact.Components.Bounce#bounce
|
||||
* @type {number}
|
||||
|
|
|
@ -7,7 +7,8 @@
|
|||
var TYPE = require('../TYPE');
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* The Impact Check Against component.
|
||||
* Should be applied as a mixin.
|
||||
*
|
||||
* @name Phaser.Physics.Impact.Components.CheckAgainst
|
||||
* @since 3.0.0
|
||||
|
|
|
@ -15,7 +15,8 @@ var COLLIDES = require('../COLLIDES');
|
|||
*/
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* The Impact Collides component.
|
||||
* Should be applied as a mixin.
|
||||
*
|
||||
* @name Phaser.Physics.Impact.Components.Collides
|
||||
* @since 3.0.0
|
||||
|
|
|
@ -5,7 +5,8 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* The Impact Debug component.
|
||||
* Should be applied as a mixin.
|
||||
*
|
||||
* @name Phaser.Physics.Impact.Components.Debug
|
||||
* @since 3.0.0
|
||||
|
|
|
@ -5,7 +5,8 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* The Impact Friction component.
|
||||
* Should be applied as a mixin.
|
||||
*
|
||||
* @name Phaser.Physics.Impact.Components.Friction
|
||||
* @since 3.0.0
|
||||
|
|
|
@ -5,7 +5,8 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* The Impact Gravity component.
|
||||
* Should be applied as a mixin.
|
||||
*
|
||||
* @name Phaser.Physics.Impact.Components.Gravity
|
||||
* @since 3.0.0
|
||||
|
|
|
@ -5,7 +5,8 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* The Impact Offset component.
|
||||
* Should be applied as a mixin.
|
||||
*
|
||||
* @name Phaser.Physics.Impact.Components.Offset
|
||||
* @since 3.0.0
|
||||
|
|
|
@ -5,7 +5,8 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* The Impact Set Game Object component.
|
||||
* Should be applied as a mixin.
|
||||
*
|
||||
* @name Phaser.Physics.Impact.Components.SetGameObject
|
||||
* @since 3.0.0
|
||||
|
|
|
@ -5,7 +5,8 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* The Impact Velocity component.
|
||||
* Should be applied as a mixin.
|
||||
*
|
||||
* @name Phaser.Physics.Impact.Components.Velocity
|
||||
* @since 3.0.0
|
||||
|
@ -13,14 +14,14 @@
|
|||
var Velocity = {
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Sets the horizontal velocity of the physics body.
|
||||
*
|
||||
* @method Phaser.Physics.Impact.Components.Velocity#setVelocityX
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {number} x - [description]
|
||||
* @param {number} x - The horizontal velocity value.
|
||||
*
|
||||
* @return {Phaser.GameObjects.GameObject} This Game Object.
|
||||
* @return {this} This Game Object.
|
||||
*/
|
||||
setVelocityX: function (x)
|
||||
{
|
||||
|
@ -30,14 +31,14 @@ var Velocity = {
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Sets the vertical velocity of the physics body.
|
||||
*
|
||||
* @method Phaser.Physics.Impact.Components.Velocity#setVelocityY
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {number} y - [description]
|
||||
* @param {number} y - The vertical velocity value.
|
||||
*
|
||||
* @return {Phaser.GameObjects.GameObject} This Game Object.
|
||||
* @return {this} This Game Object.
|
||||
*/
|
||||
setVelocityY: function (y)
|
||||
{
|
||||
|
@ -47,15 +48,15 @@ var Velocity = {
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Sets the horizontal and vertical velocities of the physics body.
|
||||
*
|
||||
* @method Phaser.Physics.Impact.Components.Velocity#setVelocity
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {number} x - [description]
|
||||
* @param {number} [y=x] - [description]
|
||||
* @param {number} x - The horizontal velocity value.
|
||||
* @param {number} [y=x] - The vertical velocity value. If not given, defaults to the horizontal value.
|
||||
*
|
||||
* @return {Phaser.GameObjects.GameObject} This Game Object.
|
||||
* @return {this} This Game Object.
|
||||
*/
|
||||
setVelocity: function (x, y)
|
||||
{
|
||||
|
@ -68,15 +69,15 @@ var Velocity = {
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Sets the maximum velocity this body can travel at.
|
||||
*
|
||||
* @method Phaser.Physics.Impact.Components.Velocity#setMaxVelocity
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {number} x - [description]
|
||||
* @param {number} [y=x] - [description]
|
||||
* @param {number} x - The maximum allowed horizontal velocity.
|
||||
* @param {number} [y=x] - The maximum allowed vertical velocity. If not given, defaults to the horizontal value.
|
||||
*
|
||||
* @return {Phaser.GameObjects.GameObject} This Game Object.
|
||||
* @return {this} This Game Object.
|
||||
*/
|
||||
setMaxVelocity: function (x, y)
|
||||
{
|
||||
|
|
|
@ -9,7 +9,7 @@ var GetFastValue = require('../../utils/object/GetFastValue');
|
|||
var Vector2 = require('../../math/Vector2');
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Internal function to check if the object has a getter or setter.
|
||||
*
|
||||
* @function hasGetterOrSetter
|
||||
* @private
|
||||
|
@ -29,11 +29,11 @@ function hasGetterOrSetter (def)
|
|||
* @function Phaser.Physics.Matter.MatterGameObject
|
||||
* @since 3.3.0
|
||||
*
|
||||
* @param {Phaser.Physics.Matter.World} world - [description]
|
||||
* @param {Phaser.GameObjects.GameObject} gameObject - [description]
|
||||
* @param {object} options - [description]
|
||||
* @param {Phaser.Physics.Matter.World} world - The Matter world to add the body to.
|
||||
* @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will have the Matter body applied to it.
|
||||
* @param {object} options - Matter options config object.
|
||||
*
|
||||
* @return {Phaser.GameObjects.GameObject} [description]
|
||||
* @return {Phaser.GameObjects.GameObject} The Game Object that was created with the Matter body.
|
||||
*/
|
||||
var MatterGameObject = function (world, gameObject, options)
|
||||
{
|
||||
|
|
|
@ -28,7 +28,7 @@ var Vector = require('./lib/geometry/Vector');
|
|||
* @constructor
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.Scene} scene - [description]
|
||||
* @param {Phaser.Scene} scene - The Scene to which this Matter World instance belongs.
|
||||
* @param {object} config - [description]
|
||||
*/
|
||||
var World = new Class({
|
||||
|
@ -42,7 +42,7 @@ var World = new Class({
|
|||
EventEmitter.call(this);
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* The Scene to which this Matter World instance belongs.
|
||||
*
|
||||
* @name Phaser.Physics.Matter.World#scene
|
||||
* @type {Phaser.Scene}
|
||||
|
@ -51,7 +51,7 @@ var World = new Class({
|
|||
this.scene = scene;
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* An instance of the MatterJS Engine.
|
||||
*
|
||||
* @name Phaser.Physics.Matter.World#engine
|
||||
* @type {MatterJS.Engine}
|
||||
|
@ -109,7 +109,7 @@ var World = new Class({
|
|||
}
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* A flag that toggles if the world is enabled or not.
|
||||
*
|
||||
* @name Phaser.Physics.Matter.World#enabled
|
||||
* @type {boolean}
|
||||
|
@ -175,7 +175,7 @@ var World = new Class({
|
|||
this.autoUpdate = GetValue(config, 'autoUpdate', true);
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* A flag that controls if the debug graphics will be drawn to or not.
|
||||
*
|
||||
* @name Phaser.Physics.Matter.World#drawDebug
|
||||
* @type {boolean}
|
||||
|
@ -185,7 +185,7 @@ var World = new Class({
|
|||
this.drawDebug = GetValue(config, 'debug', false);
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* An instance of the Graphics object the debug bodies are drawn to, if enabled.
|
||||
*
|
||||
* @name Phaser.Physics.Matter.World#debugGraphic
|
||||
* @type {Phaser.GameObjects.Graphics}
|
||||
|
@ -194,7 +194,7 @@ var World = new Class({
|
|||
this.debugGraphic;
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* The default configuration values.
|
||||
*
|
||||
* @name Phaser.Physics.Matter.World#defaults
|
||||
* @type {object}
|
||||
|
@ -444,18 +444,18 @@ var World = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Creates a rectangle Matter body and adds it to the world.
|
||||
*
|
||||
* @method Phaser.Physics.Matter.World#create
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {number} x - [description]
|
||||
* @param {number} y - [description]
|
||||
* @param {number} width - [description]
|
||||
* @param {number} height - [description]
|
||||
* @param {object} options - [description]
|
||||
* @param {number} x - The horizontal position of the body in the world.
|
||||
* @param {number} y - The vertical position of the body in the world.
|
||||
* @param {number} width - The width of the body.
|
||||
* @param {number} height - The height of the body.
|
||||
* @param {object} options - Optional Matter configuration object.
|
||||
*
|
||||
* @return {MatterJS.Body} [description]
|
||||
* @return {MatterJS.Body} The Matter.js body that was created.
|
||||
*/
|
||||
create: function (x, y, width, height, options)
|
||||
{
|
||||
|
|
|
@ -142,7 +142,7 @@ var Transform = {
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Use `angle` to set or get rotation of the physics body associated to this GameObject. Unlike rotation, when using set the value can be in degrees, which will be converted to radians internally.
|
||||
*
|
||||
* @name Phaser.Physics.Matter.Components.Transform#angle
|
||||
* @type {number}
|
||||
|
@ -163,7 +163,7 @@ var Transform = {
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Use `rotation` to set or get the rotation of the physics body associated with this GameObject. The value when set must be in radians.
|
||||
*
|
||||
* @name Phaser.Physics.Matter.Components.Transform#rotation
|
||||
* @type {number}
|
||||
|
@ -186,15 +186,15 @@ var Transform = {
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Sets the position of the physics body along x and y axes. Both the parameters to this function are optional and if not passed any they default to 0.
|
||||
*
|
||||
* @method Phaser.Physics.Matter.Components.Transform#setPosition
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {number} [x=0] - [description]
|
||||
* @param {number} [y=x] - [description]
|
||||
* @param {number} [x=0] - The horizontal position of the body.
|
||||
* @param {number} [y=x] - The vertical position of the body.
|
||||
*
|
||||
* @return{Phaser.GameObjects.GameObject} This Game Object.
|
||||
* @return {this} This Game Object.
|
||||
*/
|
||||
setPosition: function (x, y)
|
||||
{
|
||||
|
@ -216,7 +216,7 @@ var Transform = {
|
|||
*
|
||||
* @param {number} [radians=0] - [description]
|
||||
*
|
||||
* @return {Phaser.GameObjects.GameObject} This Game Object.
|
||||
* @return {this} This Game Object.
|
||||
*/
|
||||
setRotation: function (radians)
|
||||
{
|
||||
|
@ -235,7 +235,7 @@ var Transform = {
|
|||
* @method Phaser.Physics.Matter.Components.Transform#setFixedRotation
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @return {Phaser.GameObjects.GameObject} This Game Object.
|
||||
* @return {this} This Game Object.
|
||||
*/
|
||||
setFixedRotation: function ()
|
||||
{
|
||||
|
@ -252,7 +252,7 @@ var Transform = {
|
|||
*
|
||||
* @param {number} [degrees=0] - [description]
|
||||
*
|
||||
* @return {Phaser.GameObjects.GameObject} This Game Object.
|
||||
* @return {this} This Game Object.
|
||||
*/
|
||||
setAngle: function (degrees)
|
||||
{
|
||||
|
@ -275,7 +275,7 @@ var Transform = {
|
|||
* @param {number} [y=x] - The vertical scale of this Game Object. If not set it will use the x value.
|
||||
* @param {Phaser.Math.Vector2} [point] - The point (Vector2) from which scaling will occur.
|
||||
*
|
||||
* @return {Phaser.GameObjects.GameObject} This Game Object.
|
||||
* @return {this} This Game Object.
|
||||
*/
|
||||
setScale: function (x, y, point)
|
||||
{
|
||||
|
|
|
@ -471,7 +471,7 @@ var WebGLRenderer = new Class({
|
|||
*
|
||||
* @param {object} config - [description]
|
||||
*
|
||||
* @return {Phaser.Renderer.WebGL.WebGLRenderer} [description]
|
||||
* @return {this} This WebGLRenderer instance.
|
||||
*/
|
||||
init: function (config)
|
||||
{
|
||||
|
@ -591,15 +591,15 @@ var WebGLRenderer = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Resizes the internal canvas and drawing buffer.
|
||||
*
|
||||
* @method Phaser.Renderer.WebGL.WebGLRenderer#resize
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {number} width - [description]
|
||||
* @param {number} height - [description]
|
||||
* @param {number} width - The width of the renderer.
|
||||
* @param {number} height - The height of the renderer.
|
||||
*
|
||||
* @return {Phaser.Renderer.WebGL.WebGLRenderer} [description]
|
||||
* @return {this} This WebGLRenderer instance.
|
||||
*/
|
||||
resize: function (width, height)
|
||||
{
|
||||
|
@ -635,15 +635,15 @@ var WebGLRenderer = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Adds a callback to be invoked when the WebGL context has been restored by the browser.
|
||||
*
|
||||
* @method Phaser.Renderer.WebGL.WebGLRenderer#onContextRestored
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {WebGLContextCallback} callback - [description]
|
||||
* @param {object} target - [description]
|
||||
* @param {WebGLContextCallback} callback - The callback to be invoked on context restoration.
|
||||
* @param {object} target - The context of the callback.
|
||||
*
|
||||
* @return {Phaser.Renderer.WebGL.WebGLRenderer} [description]
|
||||
* @return {this} This WebGLRenderer instance.
|
||||
*/
|
||||
onContextRestored: function (callback, target)
|
||||
{
|
||||
|
@ -653,15 +653,15 @@ var WebGLRenderer = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Adds a callback to be invoked when the WebGL context has been lost by the browser.
|
||||
*
|
||||
* @method Phaser.Renderer.WebGL.WebGLRenderer#onContextLost
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {WebGLContextCallback} callback - [description]
|
||||
* @param {object} target - [description]
|
||||
* @param {WebGLContextCallback} callback - The callback to be invoked on context loss.
|
||||
* @param {object} target - The context of the callback.
|
||||
*
|
||||
* @return {Phaser.Renderer.WebGL.WebGLRenderer} [description]
|
||||
* @return {this} This WebGLRenderer instance.
|
||||
*/
|
||||
onContextLost: function (callback, target)
|
||||
{
|
||||
|
@ -678,7 +678,7 @@ var WebGLRenderer = new Class({
|
|||
*
|
||||
* @param {string} extensionName - Name of the WebGL extension
|
||||
*
|
||||
* @return {boolean} [description]
|
||||
* @return {boolean} `true` if the extension is supported, otherwise `false`.
|
||||
*/
|
||||
hasExtension: function (extensionName)
|
||||
{
|
||||
|
@ -721,17 +721,15 @@ var WebGLRenderer = new Class({
|
|||
}
|
||||
},
|
||||
|
||||
/* Renderer State Manipulation Functions */
|
||||
|
||||
/**
|
||||
* Checks if a pipeline is present in the current WebGLRenderer
|
||||
*
|
||||
* @method Phaser.Renderer.WebGL.WebGLRenderer#hasPipeline
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {string} pipelineName - Name of the pipeline
|
||||
* @param {string} pipelineName - The name of the pipeline.
|
||||
*
|
||||
* @return {boolean} [description]
|
||||
* @return {boolean} `true` if the given pipeline is loaded, otherwise `false`.
|
||||
*/
|
||||
hasPipeline: function (pipelineName)
|
||||
{
|
||||
|
@ -744,9 +742,9 @@ var WebGLRenderer = new Class({
|
|||
* @method Phaser.Renderer.WebGL.WebGLRenderer#getPipeline
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {string} pipelineName - [description]
|
||||
* @param {string} pipelineName - The name of the pipeline.
|
||||
*
|
||||
* @return {Phaser.Renderer.WebGL.WebGLPipeline} [description]
|
||||
* @return {Phaser.Renderer.WebGL.WebGLPipeline} The pipeline instance, or `null` if not found.
|
||||
*/
|
||||
getPipeline: function (pipelineName)
|
||||
{
|
||||
|
@ -754,14 +752,14 @@ var WebGLRenderer = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* Removes a pipeline by name
|
||||
* Removes a pipeline by name.
|
||||
*
|
||||
* @method Phaser.Renderer.WebGL.WebGLRenderer#removePipeline
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {string} pipelineName - [description]
|
||||
* @param {string} pipelineName - The name of the pipeline to be removed.
|
||||
*
|
||||
* @return {Phaser.Renderer.WebGL.WebGLRenderer} [description]
|
||||
* @return {this} This WebGLRenderer instance.
|
||||
*/
|
||||
removePipeline: function (pipelineName)
|
||||
{
|
||||
|
@ -776,10 +774,10 @@ var WebGLRenderer = new Class({
|
|||
* @method Phaser.Renderer.WebGL.WebGLRenderer#addPipeline
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {string} pipelineName - [description]
|
||||
* @param {Phaser.Renderer.WebGL.WebGLPipeline} pipelineInstance - Pipeline instance must extend WebGLPipeline
|
||||
* @param {string} pipelineName - A unique string-based key for the pipeline.
|
||||
* @param {Phaser.Renderer.WebGL.WebGLPipeline} pipelineInstance - A pipeline instance which must extend WebGLPipeline.
|
||||
*
|
||||
* @return {Phaser.Renderer.WebGL.WebGLPipeline} The instance that was passed.
|
||||
* @return {Phaser.Renderer.WebGL.WebGLPipeline} The pipline instance that was passed.
|
||||
*/
|
||||
addPipeline: function (pipelineName, pipelineInstance)
|
||||
{
|
||||
|
@ -789,7 +787,7 @@ var WebGLRenderer = new Class({
|
|||
}
|
||||
else
|
||||
{
|
||||
console.warn('Pipeline', pipelineName, ' already exists.');
|
||||
console.warn('Pipeline exists: ' + pipelineName);
|
||||
}
|
||||
|
||||
pipelineInstance.name = pipelineName;
|
||||
|
@ -805,22 +803,22 @@ var WebGLRenderer = new Class({
|
|||
* @method Phaser.Renderer.WebGL.WebGLRenderer#pushScissor
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {integer} x - [description]
|
||||
* @param {integer} y - [description]
|
||||
* @param {integer} w - [description]
|
||||
* @param {integer} h - [description]
|
||||
* @param {integer} x - The x position of the scissor.
|
||||
* @param {integer} y - The y position of the scissor.
|
||||
* @param {integer} width - The width of the scissor.
|
||||
* @param {integer} height - The height of the scissor.
|
||||
*
|
||||
* @return {Phaser.Renderer.WebGL.WebGLRenderer} [description]
|
||||
* @return {integer[]} An array containing the scissor values.
|
||||
*/
|
||||
pushScissor: function (x, y, w, h)
|
||||
pushScissor: function (x, y, width, height)
|
||||
{
|
||||
var scissorStack = this.scissorStack;
|
||||
|
||||
var scissor = [ x, y, w, h ];
|
||||
var scissor = [ x, y, width, height ];
|
||||
|
||||
scissorStack.push(scissor);
|
||||
|
||||
this.setScissor(x, y, w, h);
|
||||
this.setScissor(x, y, width, height);
|
||||
|
||||
this.currentScissor = scissor;
|
||||
|
||||
|
@ -828,12 +826,17 @@ var WebGLRenderer = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* Sets the current scissor state
|
||||
* Sets the current scissor state.
|
||||
*
|
||||
* @method Phaser.Renderer.WebGL.WebGLRenderer#setScissor
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {integer} x - The x position of the scissor.
|
||||
* @param {integer} y - The y position of the scissor.
|
||||
* @param {integer} width - The width of the scissor.
|
||||
* @param {integer} height - The height of the scissor.
|
||||
*/
|
||||
setScissor: function (x, y, w, h)
|
||||
setScissor: function (x, y, width, height)
|
||||
{
|
||||
var gl = this.gl;
|
||||
|
||||
|
@ -844,15 +847,15 @@ var WebGLRenderer = new Class({
|
|||
var cw = current[2];
|
||||
var ch = current[3];
|
||||
|
||||
if (cx !== x || cy !== y || cw !== w || ch !== h)
|
||||
if (cx !== x || cy !== y || cw !== width || ch !== height)
|
||||
{
|
||||
this.flush();
|
||||
|
||||
// https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/scissor
|
||||
|
||||
if (w > 0 && h > 0)
|
||||
if (width > 0 && height > 0)
|
||||
{
|
||||
gl.scissor(x, (this.drawingBufferHeight - y - h), w, h);
|
||||
gl.scissor(x, (this.drawingBufferHeight - y - height), width, height);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -969,16 +972,16 @@ var WebGLRenderer = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Updates the function bound to a given custom blend mode.
|
||||
*
|
||||
* @method Phaser.Renderer.WebGL.WebGLRenderer#updateBlendMode
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {integer} index - [description]
|
||||
* @param {function} func - [description]
|
||||
* @param {function} equation - [description]
|
||||
* @param {integer} index - The index of the custom blend mode.
|
||||
* @param {function} func - The function to use for the blend mode.
|
||||
* @param {function} equation - The equation to use for the blend mode.
|
||||
*
|
||||
* @return {Phaser.Renderer.WebGL.WebGLRenderer} This WebGL Renderer.
|
||||
* @return {this} This WebGLRenderer instance.
|
||||
*/
|
||||
updateBlendMode: function (index, func, equation)
|
||||
{
|
||||
|
@ -996,14 +999,15 @@ var WebGLRenderer = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Removes a custom blend mode from the renderer.
|
||||
* Any Game Objects still using this blend mode will error, so be sure to clear them first.
|
||||
*
|
||||
* @method Phaser.Renderer.WebGL.WebGLRenderer#removeBlendMode
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {integer} index - [description]
|
||||
* @param {integer} index - The index of the custom blend mode to be removed.
|
||||
*
|
||||
* @return {Phaser.Renderer.WebGL.WebGLRenderer} This WebGL Renderer.
|
||||
* @return {this} This WebGLRenderer instance.
|
||||
*/
|
||||
removeBlendMode: function (index)
|
||||
{
|
||||
|
@ -1024,8 +1028,6 @@ var WebGLRenderer = new Class({
|
|||
* @since 3.12.0
|
||||
*
|
||||
* @param {boolean} [force=false] - Force a blank texture set, regardless of what's already bound?
|
||||
*
|
||||
* @return {Phaser.Renderer.WebGL.WebGLRenderer} This WebGL Renderer.
|
||||
*/
|
||||
setBlankTexture: function (force)
|
||||
{
|
||||
|
@ -1044,10 +1046,10 @@ var WebGLRenderer = new Class({
|
|||
* @method Phaser.Renderer.WebGL.WebGLRenderer#setTexture2D
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {WebGLTexture} texture - The WebGL texture that needs to be bound
|
||||
* @param {integer} textureUnit - The texture unit to which the texture will be bound
|
||||
* @param {WebGLTexture} texture - The WebGL texture that needs to be bound.
|
||||
* @param {integer} textureUnit - The texture unit to which the texture will be bound.
|
||||
*
|
||||
* @return {Phaser.Renderer.WebGL.WebGLRenderer} This WebGL Renderer.
|
||||
* @return {this} This WebGLRenderer instance.
|
||||
*/
|
||||
setTexture2D: function (texture, textureUnit)
|
||||
{
|
||||
|
@ -1073,15 +1075,14 @@ var WebGLRenderer = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* Binds a framebuffer. If there was another framebuffer already bound
|
||||
* it will force a pipeline flush.
|
||||
* Binds a framebuffer. If there was another framebuffer already bound it will force a pipeline flush.
|
||||
*
|
||||
* @method Phaser.Renderer.WebGL.WebGLRenderer#setFramebuffer
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {WebGLFramebuffer} framebuffer - The framebuffer that needs to be bound.
|
||||
*
|
||||
* @return {Phaser.Renderer.WebGL.WebGLRenderer} This WebGL Renderer.
|
||||
* @return {this} This WebGLRenderer instance.
|
||||
*/
|
||||
setFramebuffer: function (framebuffer)
|
||||
{
|
||||
|
@ -1113,15 +1114,14 @@ var WebGLRenderer = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* Binds a program. If there was another program already bound
|
||||
* it will force a pipeline flush
|
||||
* Binds a program. If there was another program already bound it will force a pipeline flush.
|
||||
*
|
||||
* @method Phaser.Renderer.WebGL.WebGLRenderer#setProgram
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {WebGLProgram} program - The program that needs to be bound
|
||||
* @param {WebGLProgram} program - The program that needs to be bound.
|
||||
*
|
||||
* @return {Phaser.Renderer.WebGL.WebGLRenderer} This WebGL Renderer.
|
||||
* @return {this} This WebGLRenderer instance.
|
||||
*/
|
||||
setProgram: function (program)
|
||||
{
|
||||
|
@ -1140,15 +1140,14 @@ var WebGLRenderer = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* Bounds a vertex buffer. If there is a vertex buffer already bound
|
||||
* it'll force a pipeline flush.
|
||||
* Bounds a vertex buffer. If there is a vertex buffer already bound it'll force a pipeline flush.
|
||||
*
|
||||
* @method Phaser.Renderer.WebGL.WebGLRenderer#setVertexBuffer
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {WebGLBuffer} vertexBuffer - The buffer that needs to be bound
|
||||
* @param {WebGLBuffer} vertexBuffer - The buffer that needs to be bound.
|
||||
*
|
||||
* @return {Phaser.Renderer.WebGL.WebGLRenderer} This WebGL Renderer.
|
||||
* @return {this} This WebGLRenderer instance.
|
||||
*/
|
||||
setVertexBuffer: function (vertexBuffer)
|
||||
{
|
||||
|
@ -1167,15 +1166,14 @@ var WebGLRenderer = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* Bounds a index buffer. If there is a index buffer already bound
|
||||
* it'll force a pipeline flush.
|
||||
* Bounds a index buffer. If there is a index buffer already bound it'll force a pipeline flush.
|
||||
*
|
||||
* @method Phaser.Renderer.WebGL.WebGLRenderer#setIndexBuffer
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {WebGLBuffer} indexBuffer - The buffer the needs to be bound
|
||||
* @param {WebGLBuffer} indexBuffer - The buffer the needs to be bound.
|
||||
*
|
||||
* @return {Phaser.Renderer.WebGL.WebGLRenderer} This WebGL Renderer.
|
||||
* @return {this} This WebGLRenderer instance.
|
||||
*/
|
||||
setIndexBuffer: function (indexBuffer)
|
||||
{
|
||||
|
@ -1193,21 +1191,18 @@ var WebGLRenderer = new Class({
|
|||
return this;
|
||||
},
|
||||
|
||||
/* Renderer Resource Creation Functions */
|
||||
|
||||
/**
|
||||
* Creates a texture from an image source. If the source is not valid
|
||||
* it creates an empty texture
|
||||
* Creates a texture from an image source. If the source is not valid it creates an empty texture.
|
||||
*
|
||||
* @method Phaser.Renderer.WebGL.WebGLRenderer#createTextureFromSource
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {object} source - [description]
|
||||
* @param {integer} width - [description]
|
||||
* @param {integer} height - [description]
|
||||
* @param {integer} scaleMode - [description]
|
||||
* @param {object} source - The source of the texture.
|
||||
* @param {integer} width - The width of the texture.
|
||||
* @param {integer} height - The height of the texture.
|
||||
* @param {integer} scaleMode - The scale mode to be used by the texture.
|
||||
*
|
||||
* @return {WebGLTexture} [description]
|
||||
* @return {?WebGLTexture} The WebGL Texture that was created, or `null` if it couldn't be created.
|
||||
*/
|
||||
createTextureFromSource: function (source, width, height, scaleMode)
|
||||
{
|
||||
|
@ -1242,24 +1237,23 @@ var WebGLRenderer = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* A wrapper for creating a WebGLTexture. If not pixel data is passed
|
||||
* it will create an empty texture.
|
||||
* A wrapper for creating a WebGLTexture. If no pixel data is passed it will create an empty texture.
|
||||
*
|
||||
* @method Phaser.Renderer.WebGL.WebGLRenderer#createTexture2D
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {integer} mipLevel - Mip level of the texture
|
||||
* @param {integer} minFilter - Filtering of the texture
|
||||
* @param {integer} magFilter - Filtering of the texture
|
||||
* @param {integer} wrapT - Wrapping mode of the texture
|
||||
* @param {integer} wrapS - Wrapping mode of the texture
|
||||
* @param {integer} format - Which format does the texture use
|
||||
* @param {object} pixels - pixel data
|
||||
* @param {integer} width - Width of the texture in pixels
|
||||
* @param {integer} height - Height of the texture in pixels
|
||||
* @param {integer} mipLevel - Mip level of the texture.
|
||||
* @param {integer} minFilter - Filtering of the texture.
|
||||
* @param {integer} magFilter - Filtering of the texture.
|
||||
* @param {integer} wrapT - Wrapping mode of the texture.
|
||||
* @param {integer} wrapS - Wrapping mode of the texture.
|
||||
* @param {integer} format - Which format does the texture use.
|
||||
* @param {object} pixels - pixel data.
|
||||
* @param {integer} width - Width of the texture in pixels.
|
||||
* @param {integer} height - Height of the texture in pixels.
|
||||
* @param {boolean} pma - Does the texture have premultiplied alpha?
|
||||
*
|
||||
* @return {WebGLTexture} Raw WebGLTexture
|
||||
* @return {WebGLTexture} The WebGLTexture that was created.
|
||||
*/
|
||||
createTexture2D: function (mipLevel, minFilter, magFilter, wrapT, wrapS, format, pixels, width, height, pma)
|
||||
{
|
||||
|
@ -1429,8 +1423,8 @@ var WebGLRenderer = new Class({
|
|||
* @method Phaser.Renderer.WebGL.WebGLRenderer#createIndexBuffer
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {ArrayBuffer} initialDataOrSize - It's either ArrayBuffer or an integer indicating the size of the vbo
|
||||
* @param {integer} bufferUsage - How the buffer is used. gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW
|
||||
* @param {ArrayBuffer} initialDataOrSize - Either ArrayBuffer or an integer indicating the size of the vbo.
|
||||
* @param {integer} bufferUsage - How the buffer is used. gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW.
|
||||
*
|
||||
* @return {WebGLBuffer} Raw index buffer
|
||||
*/
|
||||
|
@ -1449,14 +1443,14 @@ var WebGLRenderer = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Removes the given texture from the nativeTextures array and then deletes it from the GPU.
|
||||
*
|
||||
* @method Phaser.Renderer.WebGL.WebGLRenderer#deleteTexture
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {WebGLTexture} texture - [description]
|
||||
* @param {WebGLTexture} texture - The WebGL Texture to be deleted.
|
||||
*
|
||||
* @return {Phaser.Renderer.WebGL.WebGLRenderer} This WebGL Renderer.
|
||||
* @return {this} This WebGLRenderer instance.
|
||||
*/
|
||||
deleteTexture: function (texture)
|
||||
{
|
||||
|
@ -1473,14 +1467,14 @@ var WebGLRenderer = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* Wrapper for deleting a raw WebGLFramebuffer
|
||||
* Deletes a WebGLFramebuffer from the GL instance.
|
||||
*
|
||||
* @method Phaser.Renderer.WebGL.WebGLRenderer#deleteFramebuffer
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {WebGLFramebuffer} framebuffer - [description]
|
||||
* @param {WebGLFramebuffer} framebuffer - The Framebuffer to be deleted.
|
||||
*
|
||||
* @return {Phaser.Renderer.WebGL.WebGLRenderer} This WebGL Renderer.
|
||||
* @return {this} This WebGLRenderer instance.
|
||||
*/
|
||||
deleteFramebuffer: function (framebuffer)
|
||||
{
|
||||
|
@ -1490,14 +1484,14 @@ var WebGLRenderer = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Deletes a WebGLProgram from the GL instance.
|
||||
*
|
||||
* @method Phaser.Renderer.WebGL.WebGLRenderer#deleteProgram
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {WebGLProgram} program - [description]
|
||||
* @param {WebGLProgram} program - The shader program to be deleted.
|
||||
*
|
||||
* @return {Phaser.Renderer.WebGL.WebGLRenderer} This WebGL Renderer.
|
||||
* @return {this} This WebGLRenderer instance.
|
||||
*/
|
||||
deleteProgram: function (program)
|
||||
{
|
||||
|
@ -1507,14 +1501,14 @@ var WebGLRenderer = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* Wrapper for deleting a vertex or index buffer
|
||||
* Deletes a WebGLBuffer from the GL instance.
|
||||
*
|
||||
* @method Phaser.Renderer.WebGL.WebGLRenderer#deleteBuffer
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {WebGLBuffer} vertexBuffer - [description]
|
||||
* @param {WebGLBuffer} vertexBuffer - The WebGLBuffer to be deleted.
|
||||
*
|
||||
* @return {Phaser.Renderer.WebGL.WebGLRenderer} This WebGL Renderer.
|
||||
* @return {this} This WebGLRenderer instance.
|
||||
*/
|
||||
deleteBuffer: function (buffer)
|
||||
{
|
||||
|
@ -1523,16 +1517,14 @@ var WebGLRenderer = new Class({
|
|||
return this;
|
||||
},
|
||||
|
||||
/* Rendering Functions */
|
||||
|
||||
/**
|
||||
* Handles any clipping needed by the camera and renders the background
|
||||
* color if a color is visible.
|
||||
* Controls the pre-render operations for the given camera.
|
||||
* Handles any clipping needed by the camera and renders the background color if a color is visible.
|
||||
*
|
||||
* @method Phaser.Renderer.WebGL.WebGLRenderer#preRenderCamera
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.Cameras.Scene2D.Camera} camera - [description]
|
||||
* @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to pre-render.
|
||||
*/
|
||||
preRenderCamera: function (camera)
|
||||
{
|
||||
|
@ -1589,13 +1581,13 @@ var WebGLRenderer = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* Renders the foreground camera effects like flash and fading.
|
||||
* It resets the current scissor state.
|
||||
* Controls the post-render operations for the given camera.
|
||||
* Renders the foreground camera effects like flash and fading. It resets the current scissor state.
|
||||
*
|
||||
* @method Phaser.Renderer.WebGL.WebGLRenderer#postRenderCamera
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.Cameras.Scene2D.Camera} camera - [description]
|
||||
* @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to post-render.
|
||||
*/
|
||||
postRenderCamera: function (camera)
|
||||
{
|
||||
|
@ -1691,15 +1683,16 @@ var WebGLRenderer = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* The core render step for a Scene.
|
||||
* Iterates through the given Game Object's array and renders them with the given Camera.
|
||||
*
|
||||
* @method Phaser.Renderer.WebGL.WebGLRenderer#render
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.Scene} scene - [description]
|
||||
* @param {Phaser.GameObjects.GameObject} children - [description]
|
||||
* @param {number} interpolationPercentage - [description]
|
||||
* @param {Phaser.Cameras.Scene2D.Camera} camera - [description]
|
||||
* @param {Phaser.Scene} scene - The Scene to render.
|
||||
* @param {Phaser.GameObjects.GameObject} children - The Game Object's within the Scene to be rendered.
|
||||
* @param {number} interpolationPercentage - The interpolation percentage to apply. Currently un-used.
|
||||
* @param {Phaser.Cameras.Scene2D.Camera} camera - The Scene Camera to render with.
|
||||
*/
|
||||
render: function (scene, children, interpolationPercentage, camera)
|
||||
{
|
||||
|
@ -1754,7 +1747,7 @@ var WebGLRenderer = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* The post-render step happens after all Cameras in all Scenes have been rendered.
|
||||
*
|
||||
* @method Phaser.Renderer.WebGL.WebGLRenderer#postRender
|
||||
* @since 3.0.0
|
||||
|
|
Loading…
Reference in a new issue