transformで移動して表示
canvas = document.getElementById('canvas'); ctx = canvas.getContext('2d'); //標準の四角形 ctx.strokeStyle = "red"; ctx.strokeRect(80, 50, 100, 60); // 50,50移動させて表示 ctx.setTransform(1,0,0,1,50,50); //図形を描画 ctx.strokeStyle = "blue"; ctx.strokeRect(80, 50, 100, 60);