Home / Phaser / P19

Phaser error: TextureManager.getPixelAlpha: The texture source must be Image, Canvas, or Video — cause and fix

Calling getPixelAlpha on a non-bitmap frame such as a GLTexture or RenderTexture to sample

ID
P19
Engine
Phaser
Verification
源码原文(src/textures/TextureManager.js:1519)
Frequency
未公开

Original message (verbatim)

TextureManager.getPixelAlpha: The texture source must be Image, Canvas, or Video

Placeholders such as %s / %d are kept verbatim from the engine source and are not replaced with concrete values.

Trigger

Calling getPixelAlpha on a non-bitmap frame such as a GLTexture or RenderTexture to sample a single pixel alpha value.

Typical cause

getPixelAlpha requires the source to be a Canvas, Video or HTMLImageElement; other sources expose no readable pixels, so it warns and returns null.

Step-by-step fix

  1. Confirm the target texture comes from an image, Canvas or Video, not a WebGL / RenderTexture.
  2. For a WebGL or RenderTexture, read it back to a Canvas before sampling the pixel alpha.
  3. Check that the passed frame and key point to the correct source texture.

Source links

Per-entry sources and capture date are listed at /sources#P19.

Related errors

Related Phaser errors

Need an offline quick-reference checklist?

Atlas error library Pro pack: 123 error references (110 single + 13 merged) plus a quick-fix guide, $19 one-time purchase, delivered as electronic files.

View Pro pack / order

Back to the all-errors index Checkout and buy the Pro pack — $19.00