How to make an arc/circle in canvas move in a circular way and how can I draw curved line with canvas and example | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

How to make an arc/circle in canvas move in a circular way and how can I draw curved line with canvas and example

Canvas

6th May 2019, 10:14 PM
SCP 251
SCP 251 - avatar
4 Answers
+ 7
assuming you have a canvas tag assigned an id to it: In JS: var canvas = document.getElementById("your ID"); var context = canvas.getContext("2d"); //now to draw the arc context.strokeStyle = "blue"; context.beginPath(); context.arc(50,50,20,0,2*Math.pi); context.stroke(); context.fill(); Drawing an outline of a circle you use stroke. Drawing a filled circle you use fill
7th May 2019, 1:12 AM
Jay
Jay - avatar
0
Read more about canvas tag.It's an interesting one.
7th May 2019, 1:00 AM
Basel.Al_hajeri?.MBH()
Basel.Al_hajeri?.MBH() - avatar
7th May 2019, 1:02 AM
Basel.Al_hajeri?.MBH()
Basel.Al_hajeri?.MBH() - avatar
0
When you will get more information,then you will can create a lot of arts by canvas.
7th May 2019, 1:03 AM
Basel.Al_hajeri?.MBH()
Basel.Al_hajeri?.MBH() - avatar