var c,ctx;
var s;
function start(){
setTimeout(init,500); //A shorter timeout would probably do, but just to be safe.
}
setTimeout(init,500); //A shorter timeout would probably do, but just to be safe.
}
function init(){
c=document.getElementById("canvas");
ctx=c.getContext("2d");
c.setAttribute("width", document.width );
c.setAttribute("height",document.height );
s = document.width / 800;
c=document.getElementById("canvas");
ctx=c.getContext("2d");
c.setAttribute("width", document.width );
c.setAttribute("height",document.height );
s = document.width / 800;
...
}
function drawImg(img, sx, sy, sw, sh, dx, dy, dw, dh){
ctx.drawImage(img, sx, sy, sw, sh, dx*s, dy*s, dw*s, dh*s);
}
ctx.drawImage(img, sx, sy, sw, sh, dx*s, dy*s, dw*s, dh*s);
}
Geen opmerkingen:
Een reactie posten