mirror of
https://github.com/photonstorm/phaser
synced 2025-01-14 06:03:59 +00:00
27 lines
869 B
JavaScript
27 lines
869 B
JavaScript
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2022 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
|
|
/**
|
|
* 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
|
|
*
|
|
* @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return]
|
|
*
|
|
* @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} The Game Object that was positioned.
|
|
*/
|
|
var SetRight = function (gameObject, value)
|
|
{
|
|
gameObject.x = (value - gameObject.width) + (gameObject.width * gameObject.originX);
|
|
|
|
return gameObject;
|
|
};
|
|
|
|
module.exports = SetRight;
|