What is the best way of drawing with canvas js? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 11

What is the best way of drawing with canvas js?

I recently created a code with javascript and used the trial and error method which worked, but i was wondering if there is a more efficient way of drawing on canvas? here is my canvas code: https://code.sololearn.com/WYX9IOAZ2iQ3/?ref=app

3rd Jan 2020, 10:08 PM
toto
toto - avatar
2 Answers
+ 6
I'd say that is one of the most efficient ways of canvas drawing, especially with the functional abstractions. If you ever need to later dynamically change the positions of the shapes, I would recommend integrating classes. CodingTrain on YouTube has some very good videos on this concept.
3rd Jan 2020, 11:50 PM
SuperC
SuperC - avatar
+ 9
Thank you SuperC for the good explanation, I have been currently watching the CodingTrain P5, and I will definitely check out his videos on integrating classes...thank you for the recommendation and explanation.
4th Jan 2020, 1:47 AM
toto
toto - avatar