org.digimead.digi.lib.opengl

GLText

class GLText extends AnyRef

This is a OpenGL ES 1.0 dynamic font rendering system. It loads fonts, generates a font map (texture) from them, and allows rendering of text strings.

Note

the rendering portions of this class uses a sprite batcher in order provide decent speed rendering. Also, rendering assumes a BOTTOM-LEFT origin, and the (x,y) positions are relative to that, as well as the bottom-left of the string to render.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. GLText
  2. AnyRef
  3. Any
Visibility
  1. Public
  2. All

Instance Constructors

  1. new GLText(gl: GL10, assets: AssetManager)

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. val CHAR_BATCH_SIZE: Int

    Number of Characters to Render Per Batch

  7. val CHAR_CNT: Int

    Character Count (Including Character to use for Unknown)

  8. val CHAR_END: Int

    Last Character (ASCII Code)

  9. val CHAR_NONE: Int

    Character to Use for Unknown (ASCII Code)

  10. val CHAR_START: Int

    First Character (ASCII Code)

  11. val CHAR_UNKNOWN: Int

    Index of the Unknown Character

  12. val FONT_SIZE_MAX: Int

    Maximum Font Size (Pixels)

  13. val FONT_SIZE_MIN: Int

    Minumum Font Size (Pixels)

  14. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  15. val batch: SpriteBatch

    Batch Renderer, Create Sprite Batch (with Defined Size)

  16. def begin(): Unit

    call this method before respectively all draw() calls using a text instance

  17. var cellHeight: Int

    Character Cell Width/Height

    Character Cell Width/Height

    Attributes
    protected
  18. var cellWidth: Int

    Character Cell Width/Height

    Character Cell Width/Height

    Attributes
    protected
  19. var charHeight: Float

    Character Height (Maximum; Pixels)

    Character Height (Maximum; Pixels)

    Attributes
    protected
  20. val charRgn: Array[TextureRegion]

    Region of Each Character (Texture Coordinates)

  21. var charWidthMax: Float

    Character Width (Maximum; Pixels)

    Character Width (Maximum; Pixels)

    Attributes
    protected
  22. val charWidths: Array[Float]

    Width of Each Character (Actual; Pixels)

  23. def clone(): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  24. var colCnt: Int

    Number of Rows/Columns

    Number of Rows/Columns

    Attributes
    protected
  25. def draw(text: String, x: Float, y: Float): Unit

    draw text at the specified x,y position

    draw text at the specified x,y position

    text

    the string to draw

    x

    the x position to draw text at (bottom left of text; including descent)

    y

    the y position to draw text at (bottom left of text; including descent)

  26. def drawC(text: String, x: Float, y: Float): Float

    draw text CENTERED at the specified x,y position

    draw text CENTERED at the specified x,y position

    text

    the string to draw

    x

    the x position to draw text at (bottom left of text)

    y

    the y position to draw text at (bottom left of text)

    returns

    the total width of the text that was drawn

  27. def drawCX(text: String, x: Float, y: Float): Float

    draw text CENTERED at the specified x position

    draw text CENTERED at the specified x position

    text

    the string to draw

    x

    the x position to draw text at (bottom left of text)

    y

    the y position to draw text at (bottom left of text)

    returns

    the total width of the text that was drawn

  28. def drawCY(text: String, x: Float, y: Float): Unit

    draw text CENTERED at the specified y position

    draw text CENTERED at the specified y position

    text

    the string to draw

    x

    the x position to draw text at (bottom left of text)

    y

    the y position to draw text at (bottom left of text)

    returns

    the total width of the text that was drawn

  29. def drawTexture(width: Int, height: Int): Unit

    draw the entire font texture

    draw the entire font texture

    width

    the width of the area to draw to. this is used to draw the texture to the top-left corner.

    height

    the height of the area to draw to. this is used to draw the texture to the top-left corner.

    Note

    for testing purposes only)

  30. def end(): Unit

    call this method after respectively all draw() calls using a text instance

  31. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  32. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  33. def finalize(): Unit

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  34. var fontAscent: Float

    Font Ascent (Above Baseline; Pixels)

    Font Ascent (Above Baseline; Pixels)

    Attributes
    protected
  35. var fontDescent: Float

    Font Descent (Below Baseline; Pixels)

    Font Descent (Below Baseline; Pixels)

    Attributes
    protected
  36. var fontHeight: Float

    Font Height (Actual; Pixels)

    Font Height (Actual; Pixels)

    Attributes
    protected
  37. var fontPadX: Int

    Font Padding (Pixels; On Each Side, ie.

    Font Padding (Pixels; On Each Side, ie. Doubled on Both X+Y Axis)

    Attributes
    protected
  38. var fontPadY: Int

    Font Padding (Pixels; On Each Side, ie.

    Font Padding (Pixels; On Each Side, ie. Doubled on Both X+Y Axis)

    Attributes
    protected
  39. def getAscent(): Float

    get the ascent font metric (scaled)

    get the ascent font metric (scaled)

    returns

    the ascent font metric (scaled)

  40. def getCharHeight(): Float

    Return Scaled Character Height

  41. def getCharWidth(chr: Char): Float

    get the scaled width/height of a character, or max character width

    get the scaled width/height of a character, or max character width

    chr

    the character to get width for

    returns

    the requested character size (scaled)

    Note

    since all characters are the same height, no character index is required! excludes spacing!!

  42. def getCharWidthMax(): Float

    Return Scaled Max Character Width

  43. final def getClass(): java.lang.Class[_]

    Definition Classes
    AnyRef → Any
  44. def getDescent(): Float

    get the descent font metric (scaled)

    get the descent font metric (scaled)

    returns

    the descent font metric (scaled)

  45. def getHeight(): Float

    get actual font height

    get actual font height

    returns

    actual font height

  46. def getLength(text: String): Float

    get the length of the specified string if rendered using current settings

    get the length of the specified string if rendered using current settings

    text

    the string to get length for

    returns

    the length of the specified string (pixels)

  47. def getScaleX(): Float

    get the current scaling used for the font

    get the current scaling used for the font

    returns

    the x scale currently used for scale

  48. def getScaleY(): Float

    get the current scaling used for the font

    get the current scaling used for the font

    returns

    the y scale currently used for scale

  49. def getSpace(): Float

    get the current spacing used for the font

    get the current spacing used for the font

    returns

    the x space currently used for scale

  50. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  51. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  52. def load(tf: Typeface, size: Int, padX: Int, padY: Int): Boolean

    this will load the specified font file, create a texture for the defined character range, and setup all required values used to render with it.

    this will load the specified font file, create a texture for the defined character range, and setup all required values used to render with it.

    tf

    typeface instance

    size

    Requested pixel size of font (height)

    padX

    Extra padding per character X Axis to prevent overlapping characters.

    padY

    Extra padding per character Y Axis to prevent overlapping characters.

  53. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  54. final def notify(): Unit

    Definition Classes
    AnyRef
  55. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  56. var rowCnt: Int

    Number of Rows/Columns

    Number of Rows/Columns

    Attributes
    protected
  57. var scaleX: Float

    Font Scale (X,Y Axis), Default Scale = 1 (Unscaled)

    Font Scale (X,Y Axis), Default Scale = 1 (Unscaled)

    Attributes
    protected
  58. var scaleY: Float

    Font Scale (X,Y Axis), Default Scale = 1 (Unscaled)

    Font Scale (X,Y Axis), Default Scale = 1 (Unscaled)

    Attributes
    protected
  59. def setScale(sx: Float, sy: Float): Unit

    set the scaling to use for the font

    set the scaling to use for the font

    sx

    x axis scaling factors

    sy

    y axis scaling factors

  60. def setScale(scale: Float): Unit

    set the scaling to use for the font

    set the scaling to use for the font

    scale

    uniform scale for both x and y axis scaling

  61. def setSpace(space: Float): Unit

    set the spacing (unscaled; ie.

    set the spacing (unscaled; ie. pixel size) to use for the font

    space

    space for x axis spacing

  62. var spaceX: Float

    Additional (X,Y Axis) Spacing (Unscaled)

    Additional (X,Y Axis) Spacing (Unscaled)

    Attributes
    protected
  63. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  64. var textureId: Int

    Font Texture ID [NOTE: Public for Testing Purposes Only!]

    Font Texture ID [NOTE: Public for Testing Purposes Only!]

    Attributes
    protected
  65. var textureRgn: TextureRegion

    Full Texture Region

    Full Texture Region

    Attributes
    protected
  66. var textureSize: Int

    Texture Size for Font (Square) [NOTE: Public for Testing Purposes Only!]

    Texture Size for Font (Square) [NOTE: Public for Testing Purposes Only!]

    Attributes
    protected
  67. def toString(): String

    Definition Classes
    AnyRef → Any
  68. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  69. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  70. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()

Inherited from AnyRef

Inherited from Any