sfml.js
    Preparing search index...

    Class Vector2<T>

    sf::Vector2, with a native handle lazily bound to its existing storage.

    Type Parameters

    Hierarchy (View Summary)

    Index

    Constructors

    • 创建指定标量类型的二维向量;省略分量时为零,也可转换并复制源向量。

      Type Parameters

      • T extends "i8" | "u8" | "i16" | "u16" | "i32" | "u32" | "i64" | "u64" | "f32" | "f64"

      Parameters

      • scalarType: T

        分量存储类型;i64/u64 使用 bigint,其余使用 number。

      • ...args: Vector2Arguments<T> | (T extends FloatScalar ? PolarArguments : never)

        x、y 分量或源向量;浮点类型还支持半径与 Angle 极坐标。

      Returns Vector2<T>

    • 复制向量及其标量类型,副本拥有独立存储。

      Type Parameters

      • T extends "i8" | "u8" | "i16" | "u16" | "i32" | "u32" | "i64" | "u64" | "f32" | "f64"

      Parameters

      Returns Vector2<T>

    Properties

    "[mutableValue]": true

    Accessors

    • get "[vector2Native]"(): NativeValueHandle<"vector2">

      Returns NativeValueHandle<"vector2">

    Methods

    • 返回 x²+y²,按当前标量类型的精度和范围计算。

      Returns Scalar<T>