forked from phaserjs/phaser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLeftCenter.js
More file actions
30 lines (26 loc) · 927 Bytes
/
Copy pathLeftCenter.js
File metadata and controls
30 lines (26 loc) · 927 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
var GetLeft = require('../../bounds/GetLeft');
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; }
if (offsetY === undefined) { offsetY = 0; }
SetLeft(gameObject, GetLeft(container) - offsetX);
SetCenterY(gameObject, GetCenterY(container) + offsetY);
return gameObject;
};
module.exports = LeftCenter;