phaser - v4.0.0-rc.4
    Preparing search index...

    A Text Style configuration object as used by the Text Game Object.

    type TextStyle = {
        align?: string;
        backgroundColor?: string;
        baselineX?: number;
        baselineY?: number;
        color?: string | CanvasGradient | CanvasPattern;
        fixedHeight?: number;
        fixedWidth?: number;
        font?: string;
        fontFamily?: string;
        fontSize?: number | string;
        fontStyle?: string;
        letterSpacing?: number;
        lineSpacing?: number;
        maxLines?: number;
        metrics?: TextMetrics;
        padding?: TextPadding;
        resolution?: number;
        rtl?: boolean;
        shadow?: TextShadow;
        stroke?: string | CanvasGradient | CanvasPattern;
        strokeThickness?: number;
        testString?: string;
        wordWrap?: TextWordWrap;
    }
    Index

    Properties

    align?: string

    The alignment of the Text. This only impacts multi-line text. Either left, right, center or justify.

    backgroundColor?: string

    A solid fill color that is rendered behind the Text object. Given as a CSS string color such as #ff0.

    baselineX?: number

    The amount of horizontal padding added to the width of the text when calculating the font metrics.

    baselineY?: number

    The amount of vertical padding added to the height of the text when calculating the font metrics.

    color?: string | CanvasGradient | CanvasPattern

    The color the Text is drawn in. Given as a CSS string color such as #fff or rgb().

    fixedHeight?: number

    Force the Text object to have the exact height specified in this property. Leave as zero for it to change accordingly to content.

    fixedWidth?: number

    Force the Text object to have the exact width specified in this property. Leave as zero for it to change accordingly to content.

    font?: string

    The font family or font settings to set. Overrides the other font settings.

    fontFamily?: string

    The font the Text object will render with. This is a Canvas style font string.

    fontSize?: number | string

    The font size, as a CSS size string.

    fontStyle?: string

    Any addition font styles, such as 'bold'.

    letterSpacing?: number

    The amount to add to the spacing between characters. Can be a negative or positive number.

    lineSpacing?: number

    The amount to add to the font height to achieve the overall line height.

    maxLines?: number

    The maximum number of lines to display within the Text object.

    metrics?: TextMetrics

    A Text Metrics object. Use this to avoid expensive font size calculations in text heavy games.

    padding?: TextPadding

    A Text Padding object.

    resolution?: number

    Sets the resolution (DPI setting) of the Text object. Leave at zero for it to use the game resolution.

    rtl?: boolean

    Set to true if this Text object should render from right-to-left.

    shadow?: TextShadow

    The Text shadow configuration object.

    stroke?: string | CanvasGradient | CanvasPattern

    The color used to stroke the Text if the strokeThickness property is greater than zero.

    strokeThickness?: number

    The thickness of the stroke around the Text. Set to zero for no stroke.

    testString?: string

    This is the string used to aid Canvas in calculating the height of the font.

    wordWrap?: TextWordWrap

    The Text Word wrap configuration object.