0

I have this code that draw a circle on the canvas.

        create: function(){
            context.beginPath();
            context.arc(this.x, this.y, this.radius, 0, Math.PI * 2, false);
            context.fill();
        }

Is it possible to replace the circles with images?

Mark Maraya
  • 225
  • 2
  • 9

1 Answers1

0

Looks like a duplicate of HTML5 Canvas - Fill circle with image.

There's a good clipping example on MDN: https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial/Compositing#A_clip_example

Community
  • 1
  • 1
BrettJephson
  • 416
  • 5
  • 13