Answers for "make canvas cover whole screen in html"

1

canvas full screen js

(window.onresize = () => {
	canvas.width = innerWidth, canvas.height = innerHeight;
})();
Posted by: Guest on August-12-2021
0

make canvas cover whole screen in html

function resize() {
    canvas.width = window.innerWidth;
    canvas.height = window.innerHeight;
    render();
}
window.addEventListener('resize', resize, false); resize();
function render() { // draw to screen here
}
Posted by: Guest on August-11-2021

Code answers related to "make canvas cover whole screen in html"

Code answers related to "Javascript"

Browse Popular Code Answers by Language