Skip to content

format

typescript
Vector2.Set(index, value)

class: Vector2

description

Set the value of the component at the specified index in the current Vector object.

parameter

param_nametypedescription
indexnumberThe specified index position, which can be 0 or 1.
valuenumberThe value to set for the component.

reture

typedescription
void

code example

typescript
let lhs = new Vector2(1, 2);
lhs.Set(0, 1);
lhs.Set(1, 2);