dorito Posted July 2, 2018 Share Posted July 2, 2018 Hey guys, I'm trying to implement a feature where users can download a picture of the game canvas. The code below seems to be working: var game = new Phaser.Game(900, 700, Phaser.CANVAS, 'gameDiv'); // buncha code adding images and sprites var image = game.canvas.toDataURL("image/png").replace("image/png", "image/octet-stream"); window.location.href=image; However, the downloaded image has a big blank box cropped out (I've attached a screenshot to this post). I was wondering what could be causing this—could it be that a sprite is not rendering onto the canvas? I'm not familiar with how Phaser interacts with DOM elements, so thanks in advance for any advice! download Link to comment Share on other sites More sharing options...
samme Posted July 3, 2018 Share Posted July 3, 2018 Try it without the replacement. Link to comment Share on other sites More sharing options...
Recommended Posts