Canvas Resize problem ?

Hi Kirupa ,
I having trouble with ‘resizecanvas’.
I am using quick.js .
So far , the only way I can get canvas to resize correctly is by ‘location.reload();’ .
See:
http://liesandcowpies.com/quickjs/BenghaziGame.html
.html pastebin.com/jPaFjcWk
.js pastebin.com/xLcM9G4n

I tried the following code from your article:
See:
http://liesandcowpies.com/quickjs/BenghaziGame-kirupa.html
.html pastebin.com/BfBE7NUW
.js pastebin.com/Qc04CEGt
quick.js pastebin.com/Gzqef5fu

What happens below is that the canvas size is correct ,
but instead of aligned in center , it displays on screen left .
liesandcowpies.com/quickjs/BenghaziGame-kirupa.html
Is there a different approach I can use ?

Thanks…

@ line 250 ( pastebin.com/Qc04CEGt ) :

window.addEventListener('resize', resizeCanvas, false);
function resizeCanvas () {
var myCanvas = document.getElementById('canvas');
// canvasDiv = canvasDiv.align = 'center';
// myCanvas.width = document.documentElement.innerWidth;  // .inner* = Black Screen
 myCanvas.width =  document.documentElement.clientWidth;   //  .client* = bad canvas align
 myCanvas.height = document.documentElement.clientHeight;   //  .client* = bad canvas align
// myCanvas.height =  document.documentElement.innerHeight; // .inner* = Black Screen
      Quick.setAutoScale(false);
      Quick.setKeepAspect(true);
}	//

Hi, vmars!
Did you fix the problem? From looking at this link (http://liesandcowpies.com/quickjs/BenghaziGame-kirupa.html), it seems centered on the screen :slightly_smiling:

Cheers,
Kirupa

Thanks Kirupa ,
I tried both IE and Chrome .
This one works fine:
http://liesandcowpies.com/quickjs/BenghaziGame.html

This one starts off ok , but hit the maximize-btn and restore-down
back and forth a few times ; Each subsequent time is is gameCanvas get skewed to Left .
http://liesandcowpies.com/quickjs/BenghaziGame-kirupa.html

Cheers vmars