Ask coding questions

← Back to all posts
How to Put Image In CTX
ObiVibKenobi (169)
function drawSnakePart(snakePart) {
      grinchboard_ctx.fillStyle = snake_color;   
      
      grinchboard_ctx.fillRect(snakePart.x, snakePart.y, 10, 10);

      grinchboard_ctx.strokeRect(snakePart.x, snakePart.y, 10, 10);
  
}

I want to replace the fill color with an image. How could I do that?

Comments
hotnewtop