phaser/src/geom/point/Floor.js

25 lines
661 B
JavaScript
Raw Normal View History

2018-02-12 16:01:20 +00:00
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2018 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
2017-10-13 13:11:54 +00:00
/**
* Apply `Math.ceil()` to each coordinate of the given Point.
2017-10-13 13:11:54 +00:00
*
* @function Phaser.Geom.Point.Floor
* @since 3.0.0
*
2018-03-27 13:27:08 +00:00
* @generic {Phaser.Geom.Point} O - [point,$return]
*
* @param {Phaser.Geom.Point} point - The Point to floor.
2017-10-13 13:11:54 +00:00
*
* @return {Phaser.Geom.Point} The Point with `Math.floor()` applied to its coordinates.
2017-10-13 13:11:54 +00:00
*/
2017-01-03 22:21:47 +00:00
var Floor = function (point)
{
return point.setTo(Math.floor(point.x), Math.floor(point.y));
};
module.exports = Floor;