mirror of
https://github.com/photonstorm/phaser
synced 2024-11-27 07:01:20 +00:00
Added jsdocs
This commit is contained in:
parent
b415a19c71
commit
1304eab7db
15 changed files with 69 additions and 70 deletions
|
@ -2,23 +2,16 @@ var SetCenterX = require('./SetCenterX');
|
|||
var SetCenterY = require('./SetCenterY');
|
||||
|
||||
/**
|
||||
* The center x coordinate of the Game Object.
|
||||
* This is the same as `(x - offsetX) + (width / 2)`.
|
||||
*
|
||||
* @property {number} centerX
|
||||
*/
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Positions the Game Object so that it is centered on the given coordinates.
|
||||
*
|
||||
* @function Phaser.Display.Bounds.CenterOn
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.GameObjects.GameObject} gameObject - [description]
|
||||
* @param {number} x - [description]
|
||||
* @param {number} y - [description]
|
||||
* @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be re-positioned.
|
||||
* @param {number} x - The horizontal coordinate to position the Game Object on.
|
||||
* @param {number} y - The vertical coordinate to position the Game Object on.
|
||||
*
|
||||
* @return {Phaser.GameObjects.GameObject} [description]
|
||||
* @return {Phaser.GameObjects.GameObject} The Game Object that was positioned.
|
||||
*/
|
||||
var CenterOn = function (gameObject, x, y)
|
||||
{
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
/**
|
||||
* [description]
|
||||
* Returns the bottom coordinate from the bounds of the Game Object.
|
||||
*
|
||||
* @function Phaser.Display.Bounds.GetBottom
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.GameObjects.GameObject} gameObject - [description]
|
||||
* @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to get the bounds value from.
|
||||
*
|
||||
* @return {number} [description]
|
||||
* @return {number} The bottom coordinate of the bounds of the Game Object.
|
||||
*/
|
||||
var GetBottom = function (gameObject)
|
||||
{
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
/**
|
||||
* [description]
|
||||
* Returns the center x coordinate from the bounds of the Game Object.
|
||||
*
|
||||
* @function Phaser.Display.Bounds.GetCenterX
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.GameObjects.GameObject} gameObject - [description]
|
||||
* @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to get the bounds value from.
|
||||
*
|
||||
* @return {number} [description]
|
||||
* @return {number} The center x coordinate of the bounds of the Game Object.
|
||||
*/
|
||||
var GetCenterX = function (gameObject)
|
||||
{
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
/**
|
||||
* [description]
|
||||
* Returns the center y coordinate from the bounds of the Game Object.
|
||||
*
|
||||
* @function Phaser.Display.Bounds.GetCenterY
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.GameObjects.GameObject} gameObject - [description]
|
||||
* @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to get the bounds value from.
|
||||
*
|
||||
* @return {number} [description]
|
||||
* @return {number} The center y coordinate of the bounds of the Game Object.
|
||||
*/
|
||||
var GetCenterY = function (gameObject)
|
||||
{
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
/**
|
||||
* [description]
|
||||
* Returns the left coordinate from the bounds of the Game Object.
|
||||
*
|
||||
* @function Phaser.Display.Bounds.GetLeft
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.GameObjects.GameObject} gameObject - [description]
|
||||
* @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to get the bounds value from.
|
||||
*
|
||||
* @return {number} [description]
|
||||
* @return {number} The left coordinate of the bounds of the Game Object.
|
||||
*/
|
||||
var GetLeft = function (gameObject)
|
||||
{
|
||||
|
|
|
@ -1,12 +1,15 @@
|
|||
/**
|
||||
* The amount the Game Object is visually offset from its x coordinate.
|
||||
* This is the same as `width * origin.x`.
|
||||
* It will only be > 0 if origin.x is not equal to zero.
|
||||
*
|
||||
* @property {number} offsetX
|
||||
* @readOnly
|
||||
*/
|
||||
|
||||
* Returns the amount the Game Object is visually offset from its x coordinate.
|
||||
* This is the same as `width * origin.x`.
|
||||
* This value will only be > 0 if `origin.x` is not equal to zero.
|
||||
*
|
||||
* @function Phaser.Display.Bounds.GetOffsetX
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to get the bounds value from.
|
||||
*
|
||||
* @return {number} The horizontal offset of the Game Object.
|
||||
*/
|
||||
var GetOffsetX = function (gameObject)
|
||||
{
|
||||
return gameObject.width * gameObject.originX;
|
||||
|
|
|
@ -1,12 +1,15 @@
|
|||
/**
|
||||
* The amount the Game Object is visually offset from its x coordinate.
|
||||
* This is the same as `width * origin.x`.
|
||||
* It will only be > 0 if origin.x is not equal to zero.
|
||||
*
|
||||
* @property {number} offsetX
|
||||
* @readOnly
|
||||
*/
|
||||
|
||||
* Returns the amount the Game Object is visually offset from its y coordinate.
|
||||
* This is the same as `width * origin.y`.
|
||||
* This value will only be > 0 if `origin.y` is not equal to zero.
|
||||
*
|
||||
* @function Phaser.Display.Bounds.GetOffsetY
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to get the bounds value from.
|
||||
*
|
||||
* @return {number} The vertical offset of the Game Object.
|
||||
*/
|
||||
var GetOffsetY = function (gameObject)
|
||||
{
|
||||
return gameObject.height * gameObject.originY;
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
/**
|
||||
* [description]
|
||||
* Returns the right coordinate from the bounds of the Game Object.
|
||||
*
|
||||
* @function Phaser.Display.Bounds.GetRight
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.GameObjects.GameObject} gameObject - [description]
|
||||
* @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to get the bounds value from.
|
||||
*
|
||||
* @return {number} [description]
|
||||
* @return {number} The right coordinate of the bounds of the Game Object.
|
||||
*/
|
||||
var GetRight = function (gameObject)
|
||||
{
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
/**
|
||||
* [description]
|
||||
* Returns the top coordinate from the bounds of the Game Object.
|
||||
*
|
||||
* @function Phaser.Display.Bounds.GetTop
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.GameObjects.GameObject} gameObject - [description]
|
||||
* @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to get the bounds value from.
|
||||
*
|
||||
* @return {number} [description]
|
||||
* @return {number} The top coordinate of the bounds of the Game Object.
|
||||
*/
|
||||
var GetTop = function (gameObject)
|
||||
{
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
/**
|
||||
* [description]
|
||||
* Positions the Game Object so that the bottom of its bounds aligns with the given coordinate.
|
||||
*
|
||||
* @function Phaser.Display.Bounds.SetBottom
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.GameObjects.GameObject} gameObject - [description]
|
||||
* @param {number} value - [description]
|
||||
* @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be re-positioned.
|
||||
* @param {number} value - The coordinate to position the Game Object bounds on.
|
||||
*
|
||||
* @return {Phaser.GameObjects.GameObject} [description]
|
||||
* @return {Phaser.GameObjects.GameObject} The Game Object that was positioned.
|
||||
*/
|
||||
var SetBottom = function (gameObject, value)
|
||||
{
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
/**
|
||||
* [description]
|
||||
* Positions the Game Object so that the center top of its bounds aligns with the given coordinate.
|
||||
*
|
||||
* @function Phaser.Display.Bounds.SetCenterX
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.GameObjects.GameObject} gameObject - [description]
|
||||
* @param {number} x - [description]
|
||||
* @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be re-positioned.
|
||||
* @param {number} x - The coordinate to position the Game Object bounds on.
|
||||
*
|
||||
* @return {Phaser.GameObjects.GameObject} [description]
|
||||
* @return {Phaser.GameObjects.GameObject} The Game Object that was positioned.
|
||||
*/
|
||||
var SetCenterX = function (gameObject, x)
|
||||
{
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
/**
|
||||
* [description]
|
||||
* Positions the Game Object so that the center top of its bounds aligns with the given coordinate.
|
||||
*
|
||||
* @function Phaser.Display.Bounds.SetCenterY
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.GameObjects.GameObject} gameObject - [description]
|
||||
* @param {number} y - [description]
|
||||
* @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be re-positioned.
|
||||
* @param {number} y - The coordinate to position the Game Object bounds on.
|
||||
*
|
||||
* @return {Phaser.GameObjects.GameObject} [description]
|
||||
* @return {Phaser.GameObjects.GameObject} The Game Object that was positioned.
|
||||
*/
|
||||
var SetCenterY = function (gameObject, y)
|
||||
{
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
/**
|
||||
* [description]
|
||||
* Positions the Game Object so that the left of its bounds aligns with the given coordinate.
|
||||
*
|
||||
* @function Phaser.Display.Bounds.SetLeft
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.GameObjects.GameObject} gameObject - [description]
|
||||
* @param {number} value - [description]
|
||||
* @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be re-positioned.
|
||||
* @param {number} value - The coordinate to position the Game Object bounds on.
|
||||
*
|
||||
* @return {Phaser.GameObjects.GameObject} [description]
|
||||
* @return {Phaser.GameObjects.GameObject} The Game Object that was positioned.
|
||||
*/
|
||||
var SetLeft = function (gameObject, value)
|
||||
{
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
/**
|
||||
* [description]
|
||||
* Positions the Game Object so that the left of its bounds aligns with the given coordinate.
|
||||
*
|
||||
* @function Phaser.Display.Bounds.SetRight
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.GameObjects.GameObject} gameObject - [description]
|
||||
* @param {number} value - [description]
|
||||
* @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be re-positioned.
|
||||
* @param {number} value - The coordinate to position the Game Object bounds on.
|
||||
*
|
||||
* @return {Phaser.GameObjects.GameObject} [description]
|
||||
* @return {Phaser.GameObjects.GameObject} The Game Object that was positioned.
|
||||
*/
|
||||
var SetRight = function (gameObject, value)
|
||||
{
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
/**
|
||||
* [description]
|
||||
* Positions the Game Object so that the top of its bounds aligns with the given coordinate.
|
||||
*
|
||||
* @function Phaser.Display.Bounds.SetTop
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.GameObjects.GameObject} gameObject - [description]
|
||||
* @param {number} value - [description]
|
||||
* @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be re-positioned.
|
||||
* @param {number} value - The coordinate to position the Game Object bounds on.
|
||||
*
|
||||
* @return {Phaser.GameObjects.GameObject} [description]
|
||||
* @return {Phaser.GameObjects.GameObject} The Game Object that was positioned.
|
||||
*/
|
||||
var SetTop = function (gameObject, value)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue