mirror of
https://github.com/photonstorm/phaser
synced 2025-02-16 22:18:29 +00:00
Add Phaser.Geom.Line#setFromObjects()
This commit is contained in:
parent
ab9fced253
commit
f4e0f018ba
1 changed files with 22 additions and 0 deletions
|
@ -172,6 +172,28 @@ var Line = new Class({
|
|||
return this;
|
||||
},
|
||||
|
||||
/**
|
||||
* Sets this Line to match the x/y coordinates of the two given Vector2Like objects.
|
||||
*
|
||||
* @method Phaser.Geom.Line#setFromObjects
|
||||
* @since 3.61.0
|
||||
*
|
||||
* @param {Phaser.Types.Math.Vector2Like} start - Any object with public `x` and `y` properties, whose values will be assigned to the x1/y1 components of this Line.
|
||||
* @param {Phaser.Types.Math.Vector2Like} end - Any object with public `x` and `y` properties, whose values will be assigned to the x2/y2 components of this Line.
|
||||
*
|
||||
* @return {this} This Line object.
|
||||
*/
|
||||
setFromObjects: function (start, end)
|
||||
{
|
||||
this.x1 = start.x;
|
||||
this.y1 = start.y;
|
||||
|
||||
this.x2 = end.x;
|
||||
this.y2 = end.y;
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns a Vector2 object that corresponds to the start of this Line.
|
||||
*
|
||||
|
|
Loading…
Add table
Reference in a new issue