Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "widget/TextBoxE"

Index

Functions

drawTextClipped

  • drawTextClipped(renderer: Renderer, text: string, position: Vec2Like, bounds: AABB, font: Font): void
  • 文字列を領域内に描画する。

    Parameters

    • renderer: Renderer

      レンダラー。

    • text: string

      テキスト。

    • position: Vec2Like

      描画位置。

    • bounds: AABB

      描画領域。この領域内に描画する。

    • font: Font

      フォント。

    Returns void

getTextLinesHeight

  • getTextLinesHeight(text: string, width: number, font: Font): number
  • テキストの高さを求める。

    Parameters

    • text: string

      テキスト。

    • width: number

      表示幅。テキストはこの幅に従って右端で折り返される。

    • font: Font

      フォント。

    Returns number

    高さ。

typeWrite

  • typeWrite(text: string, font: Font, lineHeight: number, cursor: Vec2Like, rightBorder: number | null, bottomBorder: number | null, callback?: undefined | ((curPos: Vec2Like, glyph: Glyph) => void)): Vec2Like
  • 文字列描画。

    与えられた文字列、フォント、描画領域などに従って文字列を描画する。 この関数は各文字の描画位置を求める、実際の描画をユーザ関数に移譲する。

    Parameters

    • text: string

      テキスト。

    • font: Font

      フォント。

    • lineHeight: number

      行の高さ。

    • cursor: Vec2Like

      初期カーソル位置。

    • rightBorder: number | null

      右境界座標。これをまたぐ文字は次の行へ送られる。

    • bottomBorder: number | null

      下境界座標。カーソルのY座標がこれ以上になる時、描画は打ち切られる。

    • Optional callback: undefined | ((curPos: Vec2Like, glyph: Glyph) => void)

      描画を行う関数。省略時、何も行わない。

    Returns Vec2Like

    文字列描画後のカーソル位置。

Generated using TypeDoc