vec2

fun vec2(x: Float = 0.0f, y: Float = 0.0f): Vector2

Constructs a new Vector2 instance. An equivalent of Vector2 constructor that supports Kotlin syntax features: named parameters with default values.

Return

a new Vector2 instance storing the passed values.

Parameters

x

the X component. Defaults to 0f.

y

the Y component. Defaults to 0f.