function exportCanvasAsPNG(id, fileName, dataUrl) {
            var canvasElement = document.getElementById(id);
            var MIME_TYPE = "image/png";
            var imgURL = dataUrl;
            var dlLink = document.createElement('a');
            dlLink.download = fileName;
            dlLink.href = imgURL;
            dlLink.dataset.downloadurl = [MIME_TYPE, dlLink.download, dlLink.href].join(':');
            document.body.appendChild(dlLink);
            dlLink.click();
            document.body.removeChild(dlLink);

        }
//Function to export current canvas as PNG (With thanks to Phaser forum user @Ananth)
Function to export current canvas as PNG (With thanks to Phaser forum user @Ananth)
Function to export current canvas as PNG ( With thanks to Phaser forum user @Ananth )
function exportCanvasAsPNG(id, fileName, dataUrl) {
            var canvasElement = document.getElementById(id);
            var MIME_TYPE = "image/png";
            var imgURL = dataUrl;
            var dlLink = document.createElement('a');
            dlLink.download = fileName;
            dlLink.href = imgURL;
            dlLink.dataset.downloadurl = [MIME_TYPE, dlLink.download, dlLink.href].join(':');
            document.body.appendChild(dlLink);
            dlLink.click();
            document.body.removeChild(dlLink);
        }
function exportCanvasAsPNG ( id , fileName , dataUrl ) { var canvasElement = document . getElementById ( id ) ; var MIME_TYPE = "image/png" ; var imgURL = dataUrl ; var dlLink = document . createElement ( 'a' ) ; dlLink . download = fileName ; dlLink . href = imgURL ; dlLink . dataset . downloadurl = [ MIME_TYPE , dlLink . download , dlLink . href ] . join ( ':' ) ; document . body . appendChild ( dlLink ) ; dlLink . click ( ) ; document . body . removeChild ( dlLink ) ; }
Function to export current canvas as PNG (With thanks to Phaser forum user @Ananth)
Function to export current canvas as PNG ( With thanks to Phaser forum user @Ananth )