TextTextureOptions: {
    backgroundStyle?: string | CanvasGradient | CanvasPattern;
    font?: string;
    padding?: {
        height?: number;
        width?: number;
    };
    style?: string | CanvasGradient | CanvasPattern;
    onBackground?(ctx, text, textMetrics) => unknown;
    onText?(ctx, text, textMetrics) => unknown;
}

Type declaration

  • Optional backgroundStyle?: string | CanvasGradient | CanvasPattern

    background fillStyle

    Default

    "rgba(0, 0, 0, 0.3)"
    
  • Optional font?: string

    text font

    Default

    "128px sans-serif"
    
  • Optional padding?: {
        height?: number;
        width?: number;
    }

    nameplate canvas padding from text bounds

    • Optional height?: number

      Default

      50
      
    • Optional width?: number

      Default

      100
      
  • Optional style?: string | CanvasGradient | CanvasPattern

    text fillStyle

    Default

    "white"
    
  • onBackground?:function
    • custom background drawing

      Parameters

      • ctx: CanvasRenderingContext2D
      • text: string
      • textMetrics: TextMetrics

      Returns unknown

  • onText?:function
    • custom text drawing

      Parameters

      • ctx: CanvasRenderingContext2D
      • text: string
      • textMetrics: TextMetrics

      Returns unknown

Generated using TypeDoc