Translatew transform on the HTML5 canvas

Translatew transform on the HTML5 canvas

BY 28 Jul 2015 Web Code Snippet
Example of how you can use the translate transform on the HTML5 canvas. The rectangle normally would be at coordinates of x:20 and y:20. But using the translate transform we have moved it to the center of the screen accordingly.
Written by