我收到以下错误:
未捕获的TypeError:无法在'CanvasRenderingContext2D'上执行'drawImage':提供的值不是'(HTMLImageElement或HTMLVideoElement或HTMLCanvasElement或ImageBitmap)'
我在这里看到了同样的错误,但是实现与矿井不同.这是一个游戏,它渲染一些图像,但仍然给出了这个错误.这是我的代码:
这是chrome声明错误的行:
for (row = 0; row < numRows; row++) {
for (col = 0; col < numCols; col++) {
/* The drawImage function of the canvas' context element
* requires 3 parameters: the image to draw, the x coordinate
* to start drawing and the y coordinate to start drawing.
* We're using our Resources helpers to refer to our images
* so that we get the benefits of caching these images, since
* we're using them …Run Code Online (Sandbox Code Playgroud)