API reference
Preparing search index…

SFML shaping with native vertex storage and batched draw snapshots.

Type hierarchy

Hierarchy

  • TextResource<this> & TransformableMethods
    • Text
Source & inheritance
Member directory55

Constructors

Properties

Methods

Constructors

Properties

ClusterGrouping: typeof ClusterGrouping = ClusterGrouping

Glyph cluster grouping enumeration.

Source & inheritance
LineAlignment: typeof LineAlignment = LineAlignment

Line alignment enumeration.

Source & inheritance
Style: typeof TextStyle = TextStyle

Text style bit flags.

Source & inheritance
TextDirection: typeof TextDirection = TextDirection

Glyph layout direction enumeration.

Source & inheritance
TextOrientation: typeof TextOrientation = TextOrientation

Horizontal and vertical writing direction enumeration.

Source & inheritance

Methods

  • Returns world coordinates of the specified character; index counts Unicode code points.

    Parameters

    this
    index
    number

    Returns

    Use getShapedGlyphs() to obtain the complete layout.

    Source & inheritance
  • Returns the character size in pixels.

    Returns

    number
    Source & inheritance
  • Returns a copy of the fill color.

    Returns

    Source & inheritance
  • Returns a read-only reference to the current font.

    Returns

    Readonly
    Source & inheritance
  • Returns the letter spacing factor.

    Returns

    number
    Source & inheritance
  • Returns the line spacing factor.

    Returns

    number
    Source & inheritance
  • Returns the local axis-aligned bounds of the shaped text.

    Returns

    Source & inheritance
  • Returns a copy of the outline color.

    Returns

    Source & inheritance
  • Returns the outline thickness in pixels.

    Returns

    number
    Source & inheritance
  • Returns mutable outline vertex data; retrieve it again after the next geometry rebuild.

    Returns

    Source & inheritance
  • Return a copy of the rotation normalized to [0°, 360°).

    Returns

    Source & inheritance
  • Shapes on demand and returns glyph layout views; cluster is a JS UTF-16 index.

    Returns

    readonly ShapedGlyph[]
    Source & inheritance
  • Returns the current JS string.

    Returns

    string
    Source & inheritance
  • Returns mutable fill vertex data; retrieve it again after the next geometry rebuild.

    Returns

    Source & inheritance
  • Sets the character size in pixels.

    Parameters

    this
    TextResource
    size
    number

    Returns

    void
    Source & inheritance
  • Sets the glyph cluster grouping strategy for shaping.

    Parameters

    this
    TextResource

    Returns

    void
    Source & inheritance
  • Copies the fill color; existing geometry is only recolored.

    Parameters

    this
    TextResource

    Returns

    void
    Source & inheritance
  • Sets the font and retains its reference.

    Parameters

    this
    TextResource
    font
    Readonly

    Returns

    void
    Source & inheritance
  • Sets a synchronous glyph appearance callback, or null to remove it; the callback runs when geometry is rebuilt.

    Parameters

    this
    TextResource
    processor

    Returns

    void
    Source & inheritance
  • Sets the letter spacing factor; 1 is the default spacing.

    Parameters

    this
    TextResource
    factor
    number

    Returns

    void
    Source & inheritance
  • Sets the alignment of multiline text.

    Parameters

    this
    TextResource
    alignment

    Returns

    void
    Source & inheritance
  • Sets the line spacing factor; 1 is the font's default line spacing.

    Parameters

    this
    TextResource
    factor
    number

    Returns

    void
    Source & inheritance
  • Copies the outline color; existing geometry is only recolored.

    Parameters

    this
    TextResource

    Returns

    void
    Source & inheritance
  • Sets the outline thickness in pixels.

    Parameters

    this
    TextResource
    thickness
    number

    Returns

    void
    Source & inheritance
  • Sets the displayed string, reshaping on the next query or draw.

    Parameters

    this
    TextResource
    value
    string

    Returns

    void
    Source & inheritance
  • Sets TextStyle bit flags, combining styles such as bold and italic.

    Parameters

    this
    TextResource

    Returns

    void
    Source & inheritance
  • Sets horizontal or vertical writing direction.

    Parameters

    this
    TextResource
    orientation

    Returns

    void
    Source & inheritance

Symbol members

"[graphicsNative]": NativeGraphicsHandle<"text">
Source & inheritance
"[mutableValue]": true
Source & inheritance
"[transformableState]": TransformableState
Source & inheritance

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