1 decade ago by davidx
Hi,
I have an issue at the moment where by I want to be able to resize the canvas based on the available resolution.
If I try to resize by working out and using the ig.main constructor
ig.main( '#canvas', Game, frameRate, 960, 600, 1 ); I get errors on chunk size if it is not an equal division.
I can hard code the width/height directly in the css and it works perfectly.
However, I cannot seem to dynamically set the width height in JavaScript as the canvas size reduces but the scale remains the same - i.e. I am missing parts of the screen in the canvas window, perhaps I need to redraw after I resize, but not sure how?
Does anyone have any guidance?
Thanks,
Dave
I have an issue at the moment where by I want to be able to resize the canvas based on the available resolution.
If I try to resize by working out and using the ig.main constructor
ig.main( '#canvas', Game, frameRate, 960, 600, 1 ); I get errors on chunk size if it is not an equal division.
I can hard code the width/height directly in the css and it works perfectly.
However, I cannot seem to dynamically set the width height in JavaScript as the canvas size reduces but the scale remains the same - i.e. I am missing parts of the screen in the canvas window, perhaps I need to redraw after I resize, but not sure how?
Does anyone have any guidance?
Thanks,
Dave