Class Fz2D.Font

Defined in: src/scene/font.coffee

Overview

Public: Font

Instance Method Summary

Constructor Details

::constructor(texture, size = @texture, s = ' ', e = '~') Source

Public: Constructor. texture - Fz2D.Texture size - font size (default: texture.h) s - start letter (default: ' ') e - end letter (default: '~')

Parameters:

  • (Fz2D.Texture) textureFz2D.Texture
  • sizefont size (default: texture.h)
  • sstart letter (default: ' ')
  • eend letter (default: '~')

Instance Method Details

Fz2D.Rect ::centerText(ro, text) Source

Public: Centers text inside the given rect. ro - Fz2D.Rect, Fz2D.Object or Fz2D.Group text - text to measure Returns a Fz2D.Rect.

Parameters:

Returns:

::drawText(ctx, text, x, y) Source

Public: Draws Text. ctx - Fz2D.Canvas text - text to measure x - position on the X axis y - position on the Y axis Returns a last position.

Parameters:

  • (Fz2D.Canvas) ctxFz2D.Canvas
  • texttext to measure
  • xposition on the X axis
  • yposition on the Y axis

Returns:

  • Returns a last position.

Fz2D.Rect ::measureText(text) Source

Public: Measures text. text - text to measure Returns a Fz2D.Rect.

Parameters:

  • texttext to measure

Returns: