Class Fz2D.Font
| Defined in: | src/scene/font.coffee |
Overview
Public: Font
Instance Method Summary
- Fz2D.Rect ::centerText(ro, text) Centers text inside the given rect.
- ::constructor(texture, size = @texture, s = ' ', e = '~') Constructor.
- ::drawText(ctx, text, x, y) Draws Text.
- Fz2D.Rect ::measureText(text) Measures text.
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: '~')
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.
::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.