HTML5 Canvas: Manipulating Individual Paths

前端 未结 5 922
孤街浪徒
孤街浪徒 2021-01-13 01:00

How can I save a specific path to a javascript variable/array, and later manipulate it, when using an HTML5 canvas? Here\'s what I\'m doing thus far:

               


        
5条回答
  •  清酒与你
    2021-01-13 01:27

    In canvas you cannot change the canvas view without clearing it and redrawing it; therefore you need to create a function to draw the canvas. In the array store your line Positions, the during the function loop through the array and add these. Obviously you can redraw the canvas at any time; usually you will set up an event listener or timing event

提交回复
热议问题