Jump to content

Take a screenshot to hide the change of state


JanVac91
 Share

Recommended Posts

Hello everyone! I'm trying to accomplish the following task:

- When there is a change of state I want to take a screenshot of the canvas, show to the user while the state is changing.

Now I read that I should use canvas.toDataURL to obtain the base64 encoded Image. I can't understand the steps to accomplish this task.

1) I save the URL with canvas.toDataURL().

2) I should convert the base64 to an image right?

3) I should add the Image to the cache OR i Should do a load.image? 

4) The operation should be async right? Because in my trying the debugger console is saying that the image hasn't been retrieved and I don't understand how I can make toDataURL (or the conversion from base64 to png) async because there are no methods.

 

Thanks for the help! 

Link to comment
Share on other sites

As there are no states anymore, and you can run multiple scenes simultaneously, I think your question may be moot.  But, if you do want to capture an image of your current scene, you could do so with a RenderTexture.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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