TextStyle
How a text looks (engine.text(string, style)). Texts are baked once into the atlas, and again only when the string or the style changes.
Example
Section titled “Example”engine.text('0', { x: 40, y: 40, size: 48, align: 'left', outline: true })Properties
Section titled “Properties”
optionalsize?:number
Font size, stage units.
optionalfont?:string
CSS font family list.
weight?
Section titled “weight?”
optionalweight?:string|number
CSS font weight (default 700).
color?
Section titled “color?”
optionalcolor?:string
CSS colour (default cream, #FBEFE3).
align?
Section titled “align?”
optionalalign?:"left"|"right"|"center"
‘left’: x is the start; ‘center’ (default); ‘right’: x is the end. y is always the middle of the line.
outline?
Section titled “outline?”
optionaloutline?:string|boolean
A dark outline (true: the default halo colour) of this width (stage units).
outlineWidth?
Section titled “outlineWidth?”
optionaloutlineWidth?:number
The outline’s width, stage units.
shadow?
Section titled “shadow?”
optionalshadow?:string|boolean
A soft shadow (true: the default halo colour), blur in stage units.
shadowBlur?
Section titled “shadowBlur?”
optionalshadowBlur?:number
The shadow’s blur radius, stage units.
bitmapFont?
Section titled “bitmapFont?”
optionalbitmapFont?:string|BitmapFont
Draw with a bitmap font (its name, from engine.load or engine.bitmapFont, or the font): no bake per string, for texts that change often. size scales the font; the look (colour, outline) is the font’s, and tint multiplies it.