API 参考
正在准备搜索索引…

使用原生顶点存储和批量绘制快照的 SFML 文本整形。

继承关系

层级

  • TextResource<this> & TransformableMethods
    • Text
源码与继承
成员目录55

构造函数

属性

方法

构造函数

属性

ClusterGrouping: typeof ClusterGrouping = ClusterGrouping

字形簇分组枚举。

源码与继承
LineAlignment: typeof LineAlignment = LineAlignment

行对齐枚举。

源码与继承
Style: typeof TextStyle = TextStyle

文本样式位标志。

源码与继承
TextDirection: typeof TextDirection = TextDirection

字形排布方向枚举。

源码与继承
TextOrientation: typeof TextOrientation = TextOrientation

横排和竖排方向枚举。

源码与继承

方法

  • 返回指定字符的世界坐标,index 按 Unicode 码点计数。

    参数

    this
    index
    number

    返回值

    使用 getShapedGlyphs() 获取完整布局。

    源码与继承
  • 返回像素字号。

    返回值

    number
    源码与继承
  • 返回当前字体的只读引用。

    返回值

    Readonly
    源码与继承
  • 返回字间距倍率。

    返回值

    number
    源码与继承
  • 返回行间距倍率。

    返回值

    number
    源码与继承
  • 返回轮廓颜色副本。

    返回值

    源码与继承
  • 返回轮廓像素厚度。

    返回值

    number
    源码与继承
  • 返回可修改的轮廓顶点数据;下一次几何重建后需要重新获取。

    返回值

    源码与继承
  • 按需整形并返回字形布局视图;cluster 为 JS UTF-16 索引。

    返回值

    readonly ShapedGlyph[]
    源码与继承
  • 返回当前 JS 字符串。

    返回值

    string
    源码与继承
  • 返回可修改的填充顶点数据;下一次几何重建后需要重新获取。

    返回值

    源码与继承
  • 设置像素字号。

    参数

    this
    TextResource
    size
    number

    返回值

    void
    源码与继承
  • 设置整形时的字形簇分组策略。

    参数

    this
    TextResource

    返回值

    void
    源码与继承
  • 设置字体并保留其引用。

    参数

    this
    TextResource
    font
    Readonly

    返回值

    void
    源码与继承
  • 设置同步字形外观回调,null 取消;回调在几何重建时执行。

    参数

    this
    TextResource
    processor

    返回值

    void
    源码与继承
  • 设置字间距倍率,1 为默认间距。

    参数

    this
    TextResource
    factor
    number

    返回值

    void
    源码与继承
  • 设置多行文本的对齐方式。

    参数

    this
    TextResource
    alignment

    返回值

    void
    源码与继承
  • 设置行间距倍率,1 为字体默认行距。

    参数

    this
    TextResource
    factor
    number

    返回值

    void
    源码与继承
  • 设置轮廓像素厚度。

    参数

    this
    TextResource
    thickness
    number

    返回值

    void
    源码与继承
  • 设置显示字符串,下次查询或绘制时重新整形。

    参数

    this
    TextResource
    value
    string

    返回值

    void
    源码与继承
  • 设置 TextStyle 位标志,可组合粗体、斜体等样式。

    参数

    this
    TextResource

    返回值

    void
    源码与继承
  • 设置横排或竖排方向。

    参数

    this
    TextResource
    orientation

    返回值

    void
    源码与继承

符号成员

"[graphicsNative]": NativeGraphicsHandle<"text">
源码与继承
"[mutableValue]": true
源码与继承
"[transformableState]": TransformableState
源码与继承

Icons made by Lorc, Delapouite & Skoll · game-icons.net · CC BY 3.0