format
typescript
Vector2.SubAssign(rhs)class: Vector2
description
Subtracts another vector or a scalar from the current vector object and assigns the result to the current vector object.
parameter
| param_name | type | description |
|---|---|---|
| rhs | number|Vector2 | The vector or scalar to subtract. |
reture
| type | description |
|---|---|
void |
code example
typescript
let v2 = new Vector2(-1, -2);
v2.SubAssign(1);
v2.SubAssign(new Vector2(2, 3));