November 2011
Intermediate to advanced
348 pages
7h 2m
English
Another interesting use of the scale transformation is its ability to mirror the canvas context vertically or horizontally. In this recipe, we'll mirror the canvas context horizontally, and then write out some backwards text.

Follow these steps to write text backwards:
window.onload = function(){
var canvas = document.getElementById("myCanvas");
var context = canvas.getContext("2d");x value:// translate context to center of canvas context.translate(canvas.width / 2, canvas.height / 2); // flip context ...
Read now
Unlock full access