This page is work-in-progress. You can reach me on twitter or mail to rezoner1337@gmail.com

circle

Creates a circle path

cq().circle(x, y, radius);

Example

  var layer = cq(300, 300).clear("#048").appendTo(document.body);

  layer
    .fillStyle("#0af")
    .beginPath()
    .circle(150, 150, 50)
    .fill();

Use it with clip

Move your mouse around.

playground({

  width: 128,
  height: 128,

  smoothing: false,

  scaleToFit: true,

  create: function() {
    this.loadImages("earth");
  },

  render: function() {
    this.layer.clear("#004");

    this.layer.save();

    this.layer
      .beginPath()
      .circle(this.mouse.x, this.mouse.y, 32)
      .clip();

    this.layer.drawImage(this.images.earth, 0, 0);

    this.layer.restore();
  },

  container: exampleContainer  
});


Have any questions? Don't hesitate to ask:

Post issues on github, support my work on gratipay author rezoner