gameify. Text

new Text(text, xopt, yopt, styleopt, sizeopt)

A drawable string of text

Parameters:
NameTypeAttributesDefaultDescription
textString

The text string to draw

xNumber<optional>
0

x coordinate of the top left of the text

yNumber<optional>
0

y coordinate of the top left of the text

stylegameify.TextStyle<optional>

The text style

sizeNumber<optional>
48

The text size, in pixels

Example
// A text label
let myText = new gameify.Text("Hello, World", 0, 0);

Members

position :gameify.Vector2d

The position of the text top left corner of the text

size :Number

The text size, in pixels

Type:
  • Number

string :String

The string of text to draw

Type:
  • String

style :gameify.TextStyle

The text style

Methods

draw()

Draw the Text

getParent() → {gameify.Screen}

Get the screen this sprite draws to

Returns:
Type: 
gameify.Screen