+ 2
Some Questions about JS canvas
Could somebody tell me how canvas.beginpath() work? I searched it and found that if I had use canvas.translate() than it didn't goto (0,0). And if I use canvas.moveTo() without canvas.beginpath() it also can return to (0,0). And use canvas.strokeStyle it may use the last color,I'm very comfused now... Thanks for helping me :) Forgive my poor Eng Orz... 中文版: canvas.beginpath()是重置回哪裡? canvas.moveTo()是不是不影響是否有canvas.beginpath()存在? canvas.translate()的改變配canvas.beginpath()無法回去未改變前? canvas.strokeStyle是以最後的顏色來判定對嗎? 或許這樣講比較直接>< Where I trying from:https://www.w3schools.com/tags/canvas_beginpath.asp https://code.sololearn.com/WOhZeaN0sHrR/?ref=app
4 odpowiedzi
+ 6
What helped me was a YouTube video about the canvas. You can watch it here https://www.youtube.com/watch?v=eL1X8urHJmA
That's just an introduction, so watch their other videos too. Sometimes you need a lecturer to explain things better to you.
This is my greatest canvas work so far, https://code.sololearn.com/W0ZF06THFF8O/?ref=app
+ 6
You start a path with canvas.beginPath() and the end it with canvas.stroke() or canvas.fill()
+ 3
Uhhhhh Also sorry to unable to understand what you doubt
Can you show your code beside?
+ 1
So after i watch the video is that canvas.beginpath() is used to reset the start point ,and tell compiler that i want to draw a path?,maybe it is not necessary?
(I didn't watch them all.....)