phaser/src/geom/circle/Clone.js

25 lines
735 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}
*/
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;