SHARE
TWEET

Untitled

a guest Feb 21st, 2020 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var canvas = document.getElementById('canvas');
  2. var ctx = canvas.getContext('2d');
  3.  
  4. ctx.beginPath();
  5. //arc(x,y,r,sAngle,eAngle,counterclockwise);
  6. ctx.arc(75, 75, 50, 0, Math.PI * 2); // Outer circle
  7. ctx.moveTo(110, 75);
  8. ctx.fillStyle = "yellow";
  9. ctx.fill();
  10.  
  11.  
  12. ctx.arc(75, 75, 35, 0, Math.PI); // Mouth (clockwise)
  13. ctx.moveTo(65, 65);
  14. ctx.beginPath();
  15. ctx.arc(60, 65, 5, 0, Math.PI * 2); // Left eye
  16. ctx.moveTo(95, 65);
  17. ctx.fillStyle = "black";
  18. ctx.fill();
  19. ctx.arc(90, 65, 5, 0, Math.PI * 2); // Right eye
  20. ctx.stroke();
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top