Class Fz2D.Gui.Label

Defined in: src/scene/objects/gui/label.coffee
Inherits: Fz2D.Object

Overview

Public: Label

Instance Method Summary

Inherited Method Summary

Methods inherited from Fz2D.Object

.constructor, .kill, .reset, .show, .hide, .draw, .update

Constructor Details

::constructor(text, x, y, font) Source

Public: Constructor text - text to display x - position on the X axis y - position on the Y axis font - Fz2D.Font

Parameters:

  • texttext to display
  • xposition on the X axis
  • yposition on the Y axis
  • (Fz2D.Font) fontFz2D.Font

Instance Method Details

::dec(amount = 1) Source

Public: Decrements the value by a given amount. amount - amount to decrement by (default: 1)

Parameters:

  • amountamount to decrement by (default: 1)

::draw(ctx) Source

Public: Draw label on every frame. ctx - Fz2D.Canvas

Parameters:

::inc(amount = 1) Source

Public: Increments the value by a given amount. amount - amount to increment by (default: 1)

Parameters:

  • amountamount to increment by (default: 1)

::is(text) Source

Public: Determines if the text is equal to a user provided text. text - user provided text Returns true or false depending on the result of the comparison.

Parameters:

  • textuser provided text

Returns:

  • Returns true or false depending on the result of the comparison.

::setFormat(format) Source

Public: Sets the format. format - text format

Parameters:

  • formattext format

::setText(text) Source

Public: Sets the text. text - text to display

Parameters:

  • texttext to display

::toInt() Source

Public: Returns the value as an int.

::update(timer, input) Source

Public: Updates label on every frame. timer - Fz2D.Timer input - Fz2D.Input

Parameters: