yhzmr442 / jspce

PC Engine(TurboGrafx-16) Emulator written in Javascript
MIT License
2 stars 0 forks source link

Fullscreen #4

Open shaan1974 opened 4 years ago

shaan1974 commented 4 years ago

Hello, is it possible to add a bouton to have the canvas in fullscreen ?

function fullScreen()
{
    var iframe = document.getElementById("canvas0");
    launchIntoFullscreen(iframe);
}

function launchIntoFullscreen(element) {
        if(element.requestFullscreen) {
            element.requestFullscreen();
        } else if(element.mozRequestFullScreen) {
            element.mozRequestFullScreen();
        } else if(element.webkitRequestFullscreen) {
            element.webkitRequestFullscreen();
        } else if(element.msRequestFullscreen) {
            element.msRequestFullscreen();
        } else {
                console.log('what');
        }
    }