Creates a new ObservablePoint
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
observer |
Observer<ObservablePoint> |
Observer to pass to listen for change events. |
||
x |
number |
<optional> |
0 |
position of the point on the x axis |
y |
number |
<optional> |
0 |
position of the point on the y axis |
Implements
Members
Position of the observable point on the x axis.
Position of the observable point on the y axis.
Methods
clone (observer) ObservablePoint
Creates a clone of this point.
| Name | Type | Attributes | Description |
|---|---|---|---|
observer |
Observer<ObservablePoint> |
<optional> |
Optional observer to pass to the new observable point. |
Returns:
| Type | Description |
|---|---|
| ObservablePoint | a copy of this observable point |
Copies x and y from the given point (p)
| Name | Type | Description |
|---|---|---|
p |
PointData |
The point to copy from. Can be any of type that is or extends |
Returns:
| Type | Description |
|---|---|
| this | The observable point instance itself |
Copies this point's x and y into that of the given point (p)
| Name | Type | Description |
|---|---|---|
p |
T |
The point to copy to. Can be any of type that is or extends |
Returns:
| Type | Description |
|---|---|
| T | The point (p) with values updated |
Accepts another point (p) and returns true if the given point is equal to this point
| Name | Type | Description |
|---|---|---|
p |
PointData |
The point to check |
Returns:
| Type | Description |
|---|---|
| boolean | Returns true if both x and y are equal |
Sets the point to a new x and y position.
If y is omitted, both x and y will be set to x.
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
x |
number |
<optional> |
0 |
position of the point on the x axis |
y |
number |
<optional> |
x |
position of the point on the y axis |
Returns:
| Type | Description |
|---|---|
| this | The observable point instance itself |