Function fromAlphaTexture

  • Carves an alpha-mask "stamp" into the bitmap. The source is positioned with its top-left at (dstX, dstY); every source pixel whose alpha channel is at or above threshold causes the corresponding bitmap cell to be set to air.

    The Phaser integration layer extracts an ImageData from a texture (via canvas / DynamicTexture) and forwards it here. Core never imports a DOM type — AlphaSource is structural so any RGBA buffer works.

    Parameters

    • bitmap: ChunkedBitmap
    • source: AlphaSource
    • dstX: number
    • dstY: number
    • threshold: number = DEFAULT_ALPHA_THRESHOLD

      Alpha cutoff in 0..255. Default 128.

    Returns void