gameify. TextStyle

new TextStyle(fontopt, sizeopt, fillColoropt, strokeColoropt, strokeWidthopt)

Text style data

Parameters:
NameTypeAttributesDefaultDescription
fontString<optional>
'sans-serif'

The text font

sizeNumber<optional>
24

The text size, in pixels

fillColorString<optional>
'#000f'

The fill color

strokeColorString<optional>
'#000f'

The stroke color. (Stroke paint is disabled by default - use TextStyle.setPaint to enable stroke)

strokeWidthNumber<optional>
1

The stroke width

Members

font :String

The text font

Type:
  • String

lineHeight :Number

The line height, relative to the font size

Type:
  • Number
Default Value
  • 1

opacity :Number

The opacity of the text

Type:
  • Number
Default Value
  • 1

size :Number

The text size, in pixels

Type:
  • Number

Methods

getFill() → {Object}

Get the fill paint settings

Returns:

{paint: Boolean, color: String}

Type: 
Object

getStroke() → {Object}

Get the stroke paint settings

Returns:

{paint: Boolean, color: String}

Type: 
Object

setPaint(fillopt, fillColoropt, strokeColoropt, strokeWidthopt)

Set the paint options

Parameters:
NameTypeAttributesDescription
fillString<optional>

"fill", "stroke", "none" or "both"

fillColorString<optional>

The text fill color

strokeColorString<optional>

The text stroke color

strokeWidthString<optional>

The text stroke width