Class Fz2D.Gui.TextButton

Defined in: src/scene/objects/gui/text_button.coffee
Inherits: Fz2D.Gui.Button

Overview

Public: Text Button

Instance Method Summary

Inherited Method Summary

Methods inherited from Fz2D.Gui.Button

.constructor, .onclick, .update

Methods inherited from Fz2D.Entity

.constructor, .isOutOfBounds, .play, .stop, .is, .active, .addAnimation, .draw, .update

Methods inherited from Fz2D.Object

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

Constructor Details

::constructor(x, y, text, font, up, down = up, over = down) Source

Public: Constructor x - position on the X axis y - position on the Y axis text - label text font - label font up - Fz2D.Texture down - Fz2D.Texture (default: up) over - Fz2D.Texture (default: down)

Parameters:

  • xposition on the X axis
  • yposition on the Y axis
  • textlabel text
  • fontlabel font
  • (Fz2D.Texture) upFz2D.Texture
  • (Fz2D.Texture) downFz2D.Texture (default: up)
  • (Fz2D.Texture) overFz2D.Texture (default: down)

Instance Method Details

::draw(ctx) Source

Public: Draws button on every frame. ctx - Fz2D.Canvas

Parameters:

::setText(text) Source

Public: Sets the text of the label. text - the actual label

Parameters:

  • textthe actual label