Answers for "js canvas draw polygon"

3

js canvas draw polygon

var ctx = canvas.getContext('2d');
ctx.fillStyle = '#f00';
ctx.beginPath();
ctx.moveTo(0, 0);
ctx.lineTo(100,50);
ctx.lineTo(50, 100);
ctx.lineTo(0, 90);
ctx.closePath();
ctx.fill();
Posted by: Guest on November-18-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language