format
typescript
Vector2.Mul(rhs)class: Vector2
description
Multiplies the current vector object by another vector or a scalar value and returns the resulting vector.
parameter
| param_name | type | description |
|---|---|---|
| rhs | number|Vector2 | The vector or scalar value to multiply by. |
reture
| type | description |
|---|---|
Vector2 | Returns a new Vector2 object representing the result of multiplying the current vector object by rhs. |
code example
typescript
let v2 = new Vector2(-1, -2);
let mul_number = v2.Mul(1);
let mul_v2 = v2.Mul(new Vector2(2, 3));