forked from phaserjs/phaser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGetCenterY.js
More file actions
22 lines (20 loc) · 701 Bytes
/
Copy pathGetCenterY.js
File metadata and controls
22 lines (20 loc) · 701 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2018 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* 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 - The Game Object to get the bounds value from.
*
* @return {number} The center y coordinate of the bounds of the Game Object.
*/
var GetCenterY = function (gameObject)
{
return gameObject.y - (gameObject.height * gameObject.originY) + (gameObject.height * 0.5);
};
module.exports = GetCenterY;