valentinaCom Posted October 2, 2014 Share Posted October 2, 2014 hi I'm trying to take a screenshot of my canvas and adding it (as an image) to my game. actually, I have in my game an image in the corner that keep chenging according to what I have in the canvas (like a picture of the canvas that update everytime something change in it) I thought of checking everytime for a change, and if there is one to take a screenshot of canvas and adding it as an image. I tried with "game.canvas.toDataURL();" but all I got is a black image. help? thanks Link to comment Share on other sites More sharing options...
Sebi Posted October 2, 2014 Share Posted October 2, 2014 You need to either render your canvas using a canvasrenderer instance or to preserve the drawing buffer for webgl.However taking snaphots of a canvas whenever something is changing will drop your games performance and probably makes it unplayable for some people. Why are you taking those snapshots? Maybe there is a more performant way to solve your issue. Link to comment Share on other sites More sharing options...
valentinaCom Posted October 2, 2014 Author Share Posted October 2, 2014 ok the rander idea sounds good.. but can you show me how to use it? I new in phaser and js and I'm searching for a solution for a lot of time now and found nothing.. Link to comment Share on other sites More sharing options...
Recommended Posts