format
typescript
Vector2.Add(rhs)class: Vector2
description
Adds the current vector object with another vector or a number, and returns the resulting vector.
parameter
| param_name | type | description |
|---|---|---|
| rhs | number|Vector2 | The vector or number to add. |
reture
| type | description |
|---|---|
Vector2 | Returns a new Vector2 object representing the result of adding the current vector object with rhs. |
code example
typescript
let v2 = new Vector2(-1, -2);
let add_number = v2.Add(1);
let add_v2 = v2.Add(new Vector2(2, 3));