Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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
}
 
PREVIOUS NEXT
Tagged: #canvas #cover #screen #html
ADD COMMENT
Topic
Name
7+5 =