Skip to content

format

typescript
Vector2.AddAssign(rhs)

class: Vector2

description

Adds the current vector object with another vector or a scalar value, and assigns the result to the current vector object.

parameter

param_nametypedescription
rhsnumber|Vector2The vector or scalar value to add.

reture

typedescription
void

code example

typescript
let v2 = new Vector2(-1, -2);
v2.AddAssign(1);
v2.AddAssign(new Vector2(2, 3));