Javascript – Canvas

Javascript – Canvas

Canvas is a transparent HTML element that is used for drawing and animation. To draw or animate on the canvas we first need to create the HTML element. Then in Javascript, we need to get the canvas reference, create a context object and then we can draw on it. with save() function you save/push the context setting to the stack and with the restore() function you get/pop the last setting from the stack. Animating If you want to animate object on the canvas there is an animation loop: Clear the…

Javascript – Canvas Read More