mirror of
https://github.com/photonstorm/phaser
synced 2025-02-17 06:28:30 +00:00
Merge branch 'master' of https://github.com/photonstorm/phaser
This commit is contained in:
commit
74cd3c5d93
1 changed files with 20 additions and 0 deletions
|
@ -279,6 +279,26 @@ var Transform = {
|
|||
return this;
|
||||
},
|
||||
|
||||
/**
|
||||
* Copies an object's coordinates to this Game Object's position.
|
||||
*
|
||||
* @method Phaser.GameObjects.Components.Transform#copyPosition
|
||||
* @since 3.50.0
|
||||
*
|
||||
* @param {(Phaser.Types.Math.Vector2Like|Phaser.Types.Math.Vector3Like|Phaser.Types.Math.Vector4Like)} source - An object with numeric 'x', 'y', 'z', or 'w' properties. Undefined values are not copied.
|
||||
*
|
||||
* @return {this} This Game Object instance.
|
||||
*/
|
||||
copyPosition: function (source)
|
||||
{
|
||||
if (source.x !== undefined) { this.x = source.x; }
|
||||
if (source.y !== undefined) { this.y = source.y; }
|
||||
if (source.z !== undefined) { this.z = source.z; }
|
||||
if (source.w !== undefined) { this.w = source.w; }
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
/**
|
||||
* Sets the position of this Game Object to be a random position within the confines of
|
||||
* the given area.
|
||||
|
|
Loading…
Add table
Reference in a new issue