Class: Text

UI.Text

text graphic class

new UI.Text (game, txt, style, font)

Name Type Description
game Core.Game the game object
txt String the text itself (destined to be rendered)
style String 2d context styling (can be just color)
font String 2d cotext font description

Methods

getDimentions ()TextMetrics

get the dimentions of text element if to be rendered.
Returns:
Type Description
TextMetrics 2d context object that contains the desired width & height properties.

getText ()String

gets currently set text
Returns:
Type Description
String the text

render ()

renders the text element

setText (txt)

sets the text to display
Name Type Description
txt String the text to display