Adding jsdocs

This commit is contained in:
Richard Davey 2017-10-12 01:24:01 +01:00
parent 4ea560cb34
commit bdbf2a1f96
36 changed files with 414 additions and 83 deletions

View file

@ -3,6 +3,19 @@ var GetBottom = require('../../bounds/GetBottom');
var SetCenterX = require('../../bounds/SetCenterX');
var SetBottom = require('../../bounds/SetBottom');
/**
* [description]
*
* @function Phaser.Display.Align.In.BottomCenter
* @since 3.0.0
*
* @param {Phaser.GameObjects.GameObject} gameObject - [description]
* @param {Phaser.GameObjects.GameObject} container - [description]
* @param {number} [offsetX] - [description]
* @param {number} [offsetY] - [description]
*
* @return {Phaser.GameObjects.GameObject} [description]
*/
var BottomCenter = function (gameObject, container, offsetX, offsetY)
{
if (offsetX === undefined) { offsetX = 0; }

View file

@ -3,6 +3,19 @@ var GetBottom = require('../../bounds/GetBottom');
var SetLeft = require('../../bounds/SetLeft');
var SetBottom = require('../../bounds/SetBottom');
/**
* [description]
*
* @function Phaser.Display.Align.In.BottomLeft
* @since 3.0.0
*
* @param {Phaser.GameObjects.GameObject} gameObject - [description]
* @param {Phaser.GameObjects.GameObject} container - [description]
* @param {number} [offsetX] - [description]
* @param {number} [offsetY] - [description]
*
* @return {Phaser.GameObjects.GameObject} [description]
*/
var BottomLeft = function (gameObject, container, offsetX, offsetY)
{
if (offsetX === undefined) { offsetX = 0; }

View file

@ -3,6 +3,19 @@ var GetBottom = require('../../bounds/GetBottom');
var SetRight = require('../../bounds/SetRight');
var SetBottom = require('../../bounds/SetBottom');
/**
* [description]
*
* @function Phaser.Display.Align.In.BottomRight
* @since 3.0.0
*
* @param {Phaser.GameObjects.GameObject} gameObject - [description]
* @param {Phaser.GameObjects.GameObject} container - [description]
* @param {number} [offsetX] - [description]
* @param {number} [offsetY] - [description]
*
* @return {Phaser.GameObjects.GameObject} [description]
*/
var BottomRight = function (gameObject, container, offsetX, offsetY)
{
if (offsetX === undefined) { offsetX = 0; }

View file

@ -2,6 +2,19 @@ var GetCenterX = require('../../bounds/GetCenterX');
var GetCenterY = require('../../bounds/GetCenterY');
var CenterOn = require('../../bounds/CenterOn');
/**
* [description]
*
* @function Phaser.Display.Align.In.Center
* @since 3.0.0
*
* @param {Phaser.GameObjects.GameObject} gameObject - [description]
* @param {Phaser.GameObjects.GameObject} container - [description]
* @param {number} [offsetX=0] - [description]
* @param {number} [offsetY=0] - [description]
*
* @return {Phaser.GameObjects.GameObject} [description]
*/
var Center = function (gameObject, container, offsetX, offsetY)
{
if (offsetX === undefined) { offsetX = 0; }

View file

@ -3,6 +3,19 @@ var GetCenterY = require('../../bounds/GetCenterY');
var SetLeft = require('../../bounds/SetLeft');
var SetCenterY = require('../../bounds/SetCenterY');
/**
* [description]
*
* @function Phaser.Display.Align.In.LeftCenter
* @since 3.0.0
*
* @param {Phaser.GameObjects.GameObject} gameObject - [description]
* @param {Phaser.GameObjects.GameObject} container - [description]
* @param {number} [offsetX=0] - [description]
* @param {number} [offsetY=0] - [description]
*
* @return {Phaser.GameObjects.GameObject} [description]
*/
var LeftCenter = function (gameObject, container, offsetX, offsetY)
{
if (offsetX === undefined) { offsetX = 0; }

View file

@ -3,6 +3,19 @@ var GetCenterY = require('../../bounds/GetCenterY');
var SetRight = require('../../bounds/SetRight');
var SetCenterY = require('../../bounds/SetCenterY');
/**
* [description]
*
* @function Phaser.Display.Align.In.RightCenter
* @since 3.0.0
*
* @param {Phaser.GameObjects.GameObject} gameObject - [description]
* @param {Phaser.GameObjects.GameObject} container - [description]
* @param {number} [offsetX=0] - [description]
* @param {number} [offsetY=0] - [description]
*
* @return {Phaser.GameObjects.GameObject} [description]
*/
var RightCenter = function (gameObject, container, offsetX, offsetY)
{
if (offsetX === undefined) { offsetX = 0; }

View file

@ -3,6 +3,19 @@ var GetTop = require('../../bounds/GetTop');
var SetCenterX = require('../../bounds/SetCenterX');
var SetTop = require('../../bounds/SetTop');
/**
* [description]
*
* @function Phaser.Display.Align.In.TopCenter
* @since 3.0.0
*
* @param {Phaser.GameObjects.GameObject} gameObject - [description]
* @param {Phaser.GameObjects.GameObject} container - [description]
* @param {number} [offsetX=0] - [description]
* @param {number} [offsetY=0] - [description]
*
* @return {Phaser.GameObjects.GameObject} [description]
*/
var TopCenter = function (gameObject, container, offsetX, offsetY)
{
if (offsetX === undefined) { offsetX = 0; }

View file

@ -3,6 +3,19 @@ var GetTop = require('../../bounds/GetTop');
var SetLeft = require('../../bounds/SetLeft');
var SetTop = require('../../bounds/SetTop');
/**
* [description]
*
* @function Phaser.Display.Align.In.TopLeft
* @since 3.0.0
*
* @param {Phaser.GameObjects.GameObject} gameObject - [description]
* @param {Phaser.GameObjects.GameObject} container - [description]
* @param {number} [offsetX=0] - [description]
* @param {number} [offsetY=0] - [description]
*
* @return {Phaser.GameObjects.GameObject} [description]
*/
var TopLeft = function (gameObject, container, offsetX, offsetY)
{
if (offsetX === undefined) { offsetX = 0; }

View file

@ -3,6 +3,19 @@ var GetTop = require('../../bounds/GetTop');
var SetRight = require('../../bounds/SetRight');
var SetTop = require('../../bounds/SetTop');
/**
* [description]
*
* @function Phaser.Display.Align.In.TopRight
* @since 3.0.0
*
* @param {Phaser.GameObjects.GameObject} gameObject - [description]
* @param {Phaser.GameObjects.GameObject} container - [description]
* @param {number} [offsetX=0] - [description]
* @param {number} [offsetY=0] - [description]
*
* @return {Phaser.GameObjects.GameObject} [description]
*/
var TopRight = function (gameObject, container, offsetX, offsetY)
{
if (offsetX === undefined) { offsetX = 0; }

View file

@ -3,6 +3,19 @@ var GetBottom = require('../../bounds/GetBottom');
var SetCenterX = require('../../bounds/SetCenterX');
var SetTop = require('../../bounds/SetTop');
/**
* [description]
*
* @function Phaser.Display.Align.To.BottomCenter
* @since 3.0.0
*
* @param {Phaser.GameObjects.GameObject} gameObject - [description]
* @param {Phaser.GameObjects.GameObject} container - [description]
* @param {number} [offsetX=0] - [description]
* @param {number} [offsetY=0] - [description]
*
* @return {Phaser.GameObjects.GameObject} [description]
*/
var BottomCenter = function (gameObject, parent, offsetX, offsetY)
{
if (offsetX === undefined) { offsetX = 0; }

View file

@ -3,6 +3,19 @@ var GetBottom = require('../../bounds/GetBottom');
var SetLeft = require('../../bounds/SetLeft');
var SetTop = require('../../bounds/SetTop');
/**
* [description]
*
* @function Phaser.Display.Align.To.BottomLeft
* @since 3.0.0
*
* @param {Phaser.GameObjects.GameObject} gameObject - [description]
* @param {Phaser.GameObjects.GameObject} container - [description]
* @param {number} [offsetX=0] - [description]
* @param {number} [offsetY=0] - [description]
*
* @return {Phaser.GameObjects.GameObject} [description]
*/
var BottomLeft = function (gameObject, parent, offsetX, offsetY)
{
if (offsetX === undefined) { offsetX = 0; }

View file

@ -3,6 +3,19 @@ var GetBottom = require('../../bounds/GetBottom');
var SetRight = require('../../bounds/SetRight');
var SetTop = require('../../bounds/SetTop');
/**
* [description]
*
* @function Phaser.Display.Align.To.BottomRight
* @since 3.0.0
*
* @param {Phaser.GameObjects.GameObject} gameObject - [description]
* @param {Phaser.GameObjects.GameObject} container - [description]
* @param {number} [offsetX=0] - [description]
* @param {number} [offsetY=0] - [description]
*
* @return {Phaser.GameObjects.GameObject} [description]
*/
var BottomRight = function (gameObject, parent, offsetX, offsetY)
{
if (offsetX === undefined) { offsetX = 0; }

View file

@ -3,6 +3,19 @@ var GetBottom = require('../../bounds/GetBottom');
var SetRight = require('../../bounds/SetRight');
var SetBottom = require('../../bounds/SetBottom');
/**
* [description]
*
* @function Phaser.Display.Align.To.LeftBottom
* @since 3.0.0
*
* @param {Phaser.GameObjects.GameObject} gameObject - [description]
* @param {Phaser.GameObjects.GameObject} container - [description]
* @param {number} [offsetX=0] - [description]
* @param {number} [offsetY=0] - [description]
*
* @return {Phaser.GameObjects.GameObject} [description]
*/
var LeftBottom = function (gameObject, parent, offsetX, offsetY)
{
if (offsetX === undefined) { offsetX = 0; }

View file

@ -3,6 +3,19 @@ var GetCenterY = require('../../bounds/GetCenterY');
var SetRight = require('../../bounds/SetRight');
var SetCenterY = require('../../bounds/SetCenterY');
/**
* [description]
*
* @function Phaser.Display.Align.To.LeftCenter
* @since 3.0.0
*
* @param {Phaser.GameObjects.GameObject} gameObject - [description]
* @param {Phaser.GameObjects.GameObject} container - [description]
* @param {number} [offsetX=0] - [description]
* @param {number} [offsetY=0] - [description]
*
* @return {Phaser.GameObjects.GameObject} [description]
*/
var LeftCenter = function (gameObject, parent, offsetX, offsetY)
{
if (offsetX === undefined) { offsetX = 0; }

View file

@ -3,6 +3,19 @@ var GetTop = require('../../bounds/GetTop');
var SetRight = require('../../bounds/SetRight');
var SetTop = require('../../bounds/SetTop');
/**
* [description]
*
* @function Phaser.Display.Align.To.LeftTop
* @since 3.0.0
*
* @param {Phaser.GameObjects.GameObject} gameObject - [description]
* @param {Phaser.GameObjects.GameObject} container - [description]
* @param {number} [offsetX=0] - [description]
* @param {number} [offsetY=0] - [description]
*
* @return {Phaser.GameObjects.GameObject} [description]
*/
var LeftTop = function (gameObject, parent, offsetX, offsetY)
{
if (offsetX === undefined) { offsetX = 0; }

View file

@ -3,6 +3,19 @@ var GetBottom = require('../../bounds/GetBottom');
var SetLeft = require('../../bounds/SetLeft');
var SetBottom = require('../../bounds/SetBottom');
/**
* [description]
*
* @function Phaser.Display.Align.To.RightBottom
* @since 3.0.0
*
* @param {Phaser.GameObjects.GameObject} gameObject - [description]
* @param {Phaser.GameObjects.GameObject} container - [description]
* @param {number} [offsetX=0] - [description]
* @param {number} [offsetY=0] - [description]
*
* @return {Phaser.GameObjects.GameObject} [description]
*/
var RightBottom = function (gameObject, parent, offsetX, offsetY)
{
if (offsetX === undefined) { offsetX = 0; }

View file

@ -3,6 +3,19 @@ var GetCenterY = require('../../bounds/GetCenterY');
var SetLeft = require('../../bounds/SetLeft');
var SetCenterY = require('../../bounds/SetCenterY');
/**
* [description]
*
* @function Phaser.Display.Align.To.RightTop
* @since 3.0.0
*
* @param {Phaser.GameObjects.GameObject} gameObject - [description]
* @param {Phaser.GameObjects.GameObject} container - [description]
* @param {number} [offsetX=0] - [description]
* @param {number} [offsetY=0] - [description]
*
* @return {Phaser.GameObjects.GameObject} [description]
*/
var RightTop = function (gameObject, parent, offsetX, offsetY)
{
if (offsetX === undefined) { offsetX = 0; }

View file

@ -3,6 +3,19 @@ var GetTop = require('../../bounds/GetTop');
var SetLeft = require('../../bounds/SetLeft');
var SetTop = require('../../bounds/SetTop');
/**
* [description]
*
* @function Phaser.Display.Align.To.RightTop
* @since 3.0.0
*
* @param {Phaser.GameObjects.GameObject} gameObject - [description]
* @param {Phaser.GameObjects.GameObject} container - [description]
* @param {number} [offsetX=0] - [description]
* @param {number} [offsetY=0] - [description]
*
* @return {Phaser.GameObjects.GameObject} [description]
*/
var RightTop = function (gameObject, parent, offsetX, offsetY)
{
if (offsetX === undefined) { offsetX = 0; }

View file

@ -3,6 +3,19 @@ var GetTop = require('../../bounds/GetTop');
var SetCenterX = require('../../bounds/SetCenterX');
var SetBottom = require('../../bounds/SetBottom');
/**
* [description]
*
* @function Phaser.Display.Align.To.TopCenter
* @since 3.0.0
*
* @param {Phaser.GameObjects.GameObject} gameObject - [description]
* @param {Phaser.GameObjects.GameObject} container - [description]
* @param {number} [offsetX=0] - [description]
* @param {number} [offsetY=0] - [description]
*
* @return {Phaser.GameObjects.GameObject} [description]
*/
var TopCenter = function (gameObject, parent, offsetX, offsetY)
{
if (offsetX === undefined) { offsetX = 0; }

View file

@ -3,6 +3,19 @@ var GetTop = require('../../bounds/GetTop');
var SetLeft = require('../../bounds/SetLeft');
var SetBottom = require('../../bounds/SetBottom');
/**
* [description]
*
* @function Phaser.Display.Align.To.TopLeft
* @since 3.0.0
*
* @param {Phaser.GameObjects.GameObject} gameObject - [description]
* @param {Phaser.GameObjects.GameObject} container - [description]
* @param {number} [offsetX=0] - [description]
* @param {number} [offsetY=0] - [description]
*
* @return {Phaser.GameObjects.GameObject} [description]
*/
var TopLeft = function (gameObject, parent, offsetX, offsetY)
{
if (offsetX === undefined) { offsetX = 0; }

View file

@ -3,6 +3,19 @@ var GetTop = require('../../bounds/GetTop');
var SetRight = require('../../bounds/SetRight');
var SetBottom = require('../../bounds/SetBottom');
/**
* [description]
*
* @function Phaser.Display.Align.To.TopRight
* @since 3.0.0
*
* @param {Phaser.GameObjects.GameObject} gameObject - [description]
* @param {Phaser.GameObjects.GameObject} container - [description]
* @param {number} [offsetX=0] - [description]
* @param {number} [offsetY=0] - [description]
*
* @return {Phaser.GameObjects.GameObject} [description]
*/
var TopRight = function (gameObject, parent, offsetX, offsetY)
{
if (offsetX === undefined) { offsetX = 0; }

View file

@ -8,6 +8,18 @@ var SetCenterY = require('./SetCenterY');
* @property {number} centerX
*/
/**
* [description]
*
* @function Phaser.Display.Bounds.CenterOn
* @since 3.0.0
*
* @param {Phaser.GameObjects.GameObject} gameObject - [description]
* @param {number} x - [description]
* @param {number} y - [description]
*
* @return {Phaser.GameObjects.GameObject} [description]
*/
var CenterOn = function (gameObject, x, y)
{
SetCenterX(gameObject, x);

View file

@ -1,10 +1,13 @@
/**
* The left coordinate of the Game Object.
* This is the same as `x - offsetX`.
*
* @property {number} left
*/
* [description]
*
* @function Phaser.Display.Bounds.GetBottom
* @since 3.0.0
*
* @param {Phaser.GameObjects.GameObject} gameObject - [description]
*
* @return {number} [description]
*/
var GetBottom = function (gameObject)
{
return (gameObject.y + gameObject.height) - (gameObject.height * gameObject.originY);

View file

@ -1,10 +1,13 @@
/**
* The center x coordinate of the Game Object.
* This is the same as `(x - offsetX) + (width / 2)`.
*
* @property {number} centerX
*/
* [description]
*
* @function Phaser.Display.Bounds.GetCenterX
* @since 3.0.0
*
* @param {Phaser.GameObjects.GameObject} gameObject - [description]
*
* @return {number} [description]
*/
var GetCenterX = function (gameObject)
{
return gameObject.x - (gameObject.width * gameObject.originX) + (gameObject.width * 0.5);

View file

@ -1,10 +1,13 @@
/**
* The center x coordinate of the Game Object.
* This is the same as `(x - offsetX) + (width / 2)`.
*
* @property {number} centerX
*/
* [description]
*
* @function Phaser.Display.Bounds.GetCenterY
* @since 3.0.0
*
* @param {Phaser.GameObjects.GameObject} gameObject - [description]
*
* @return {number} [description]
*/
var GetCenterY = function (gameObject)
{
return gameObject.y - (gameObject.height * gameObject.originY) + (gameObject.height * 0.5);

View file

@ -1,10 +1,13 @@
/**
* The left coordinate of the Game Object.
* This is the same as `x - offsetX`.
*
* @property {number} left
*/
* [description]
*
* @function Phaser.Display.Bounds.GetLeft
* @since 3.0.0
*
* @param {Phaser.GameObjects.GameObject} gameObject - [description]
*
* @return {number} [description]
*/
var GetLeft = function (gameObject)
{
return gameObject.x - (gameObject.width * gameObject.originX);

View file

@ -1,10 +1,13 @@
/**
* The left coordinate of the Game Object.
* This is the same as `x - offsetX`.
*
* @property {number} left
*/
* [description]
*
* @function Phaser.Display.Bounds.GetRight
* @since 3.0.0
*
* @param {Phaser.GameObjects.GameObject} gameObject - [description]
*
* @return {number} [description]
*/
var GetRight = function (gameObject)
{
return (gameObject.x + gameObject.width) - (gameObject.width * gameObject.originX);

View file

@ -1,10 +1,13 @@
/**
* The y coordinate of the Game Object.
* This is the same as `y - offsetY`.
*
* @property {number} top
*/
* [description]
*
* @function Phaser.Display.Bounds.GetTop
* @since 3.0.0
*
* @param {Phaser.GameObjects.GameObject} gameObject - [description]
*
* @return {number} [description]
*/
var GetTop = function (gameObject)
{
return gameObject.y - (gameObject.height * gameObject.originY);

View file

@ -1,10 +1,14 @@
/**
* The left coordinate of the Game Object.
* This is the same as `x - offsetX`.
*
* @property {number} left
*/
* [description]
*
* @function Phaser.Display.Bounds.SetBottom
* @since 3.0.0
*
* @param {Phaser.GameObjects.GameObject} gameObject - [description]
* @param {number} value - [description]
*
* @return {Phaser.GameObjects.GameObject} [description]
*/
var SetBottom = function (gameObject, value)
{
gameObject.y = (value - gameObject.height) + (gameObject.height * gameObject.originY);

View file

@ -1,15 +1,14 @@
/**
* The center x coordinate of the Game Object.
* This is the same as `(x - offsetX) + (width / 2)`.
*
* @property {number} centerX
*/
// Phaser.Utils.Bounds.GetCenterX(bob)
// Phaser.Utils.Bounds.CenterOn(bob, x, y)
// Phaser.Utils.Bounds.CenterX(bob, x)
// Phaser.Utils.Bounds.CenterY(bob, x)
* [description]
*
* @function Phaser.Display.Bounds.SetCenterX
* @since 3.0.0
*
* @param {Phaser.GameObjects.GameObject} gameObject - [description]
* @param {number} x - [description]
*
* @return {Phaser.GameObjects.GameObject} [description]
*/
var SetCenterX = function (gameObject, x)
{
var offsetX = gameObject.width * gameObject.originX;

View file

@ -1,15 +1,14 @@
/**
* The center x coordinate of the Game Object.
* This is the same as `(x - offsetX) + (width / 2)`.
*
* @property {number} centerX
*/
// Phaser.Utils.Bounds.GetCenterX(bob)
// Phaser.Utils.Bounds.CenterOn(bob, x, y)
// Phaser.Utils.Bounds.CenterX(bob, x)
// Phaser.Utils.Bounds.CenterY(bob, x)
* [description]
*
* @function Phaser.Display.Bounds.SetCenterY
* @since 3.0.0
*
* @param {Phaser.GameObjects.GameObject} gameObject - [description]
* @param {number} y - [description]
*
* @return {Phaser.GameObjects.GameObject} [description]
*/
var SetCenterY = function (gameObject, y)
{
var offsetY = gameObject.height * gameObject.originY;

View file

@ -1,10 +1,14 @@
/**
* The left coordinate of the Game Object.
* This is the same as `x - offsetX`.
*
* @property {number} left
*/
* [description]
*
* @function Phaser.Display.Bounds.SetLeft
* @since 3.0.0
*
* @param {Phaser.GameObjects.GameObject} gameObject - [description]
* @param {number} value - [description]
*
* @return {Phaser.GameObjects.GameObject} [description]
*/
var SetLeft = function (gameObject, value)
{
gameObject.x = value + (gameObject.width * gameObject.originX);

View file

@ -1,10 +1,14 @@
/**
* The left coordinate of the Game Object.
* This is the same as `x - offsetX`.
*
* @property {number} left
*/
* [description]
*
* @function Phaser.Display.Bounds.SetRight
* @since 3.0.0
*
* @param {Phaser.GameObjects.GameObject} gameObject - [description]
* @param {number} value - [description]
*
* @return {Phaser.GameObjects.GameObject} [description]
*/
var SetRight = function (gameObject, value)
{
gameObject.x = (value - gameObject.width) + (gameObject.width * gameObject.originX);

View file

@ -1,10 +1,14 @@
/**
* The y coordinate of the Game Object.
* This is the same as `y - offsetY`.
*
* @property {number} top
*/
* [description]
*
* @function Phaser.Display.Bounds.SetTop
* @since 3.0.0
*
* @param {Phaser.GameObjects.GameObject} gameObject - [description]
* @param {number} value - [description]
*
* @return {Phaser.GameObjects.GameObject} [description]
*/
var SetTop = function (gameObject, value)
{
gameObject.y = value + (gameObject.height * gameObject.originY);

View file

@ -1,5 +1,19 @@
var ComponentToHex = require('./ComponentToHex');
/**
* [description]
*
* @function Phaser.Display.Color.RGBToString
* @since 3.0.0
*
* @param {integer} r - [description]
* @param {integer} g - [description]
* @param {integer} b - [description]
* @param {integer} [a=255] - [description]
* @param {string} [prefix=#] - [description]
*
* @return {string} [description]
*/
var RGBToString = function (r, g, b, a, prefix)
{
if (a === undefined) { a = 255; }

View file

@ -1,4 +1,4 @@
// Phaser.Graphics.Color
// Phaser.Display.Color
var Color = require('./Color');