Vec2

2D vector class with swizzling and basic operations.

Vec2

Located in ursina/vec2.py

Properties

PropertyDescription
.xX component (float)
.yY component (float)
.XInteger-cast X
.YInteger-cast Y
.yxSwizzle returning (y, x) as a Vec2

Example

from ursina.math import Vec2

a = Vec2(1, 1)
print(a)          # Vec2(1, 1)
print(round(a))   # Vec2(1, 1)