跳到主要内容

Vector2Signal

A 2D vector signal providing a reactive interface for vector operations.

Overview

Vector2Signal is a signal optimized for the Vector2 type:

const position = createSignal(new Vector2(0, 0));

// Access components
position.x(); // 0
position.y(); // 0

// Set components
.position.x(100);

// Vector chainable animation
.position().to(new Vector2(200, 100), 1);

Methods

MethodSignatureDescription
x() => numberGet X component
x(value: number) => thisSet X component
y() => numberGet Y component
y(value: number) => thisSet Y component