phaser/src/geom/circle/Clone.js

25 lines
709 B
JavaScript
Raw Normal View History

2018-02-12 16:01:20 +00:00
/**
* @author Richard Davey <rich@photonstorm.com>
2020-01-15 12:07:09 +00:00
* @copyright 2020 Photon Storm Ltd.
2019-05-10 15:15:04 +00:00
* @license {@link https://opensource.org/licenses/MIT|MIT License}
2018-02-12 16:01:20 +00:00
*/
2016-12-29 00:17:20 +00:00
var Circle = require('./Circle');
/**
2018-01-26 04:18:22 +00:00
* Creates a new Circle instance based on the values contained in the given source.
*
* @function Phaser.Geom.Circle.Clone
* @since 3.0.0
*
2018-03-20 15:01:08 +00:00
* @param {(Phaser.Geom.Circle|object)} source - The Circle to be cloned. Can be an instance of a Circle or a circle-like object, with x, y and radius properties.
2017-10-13 13:11:54 +00:00
*
* @return {Phaser.Geom.Circle} A clone of the source Circle.
*/
2016-12-29 00:17:20 +00:00
var Clone = function (source)
{
return new Circle(source.x, source.y, source.radius);
};
module.exports = Clone;