Jump to content

screenshot


valentinaCom
 Share

Recommended Posts

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

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

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...