Take a screenshot to hide the change of state

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! 

Share this post

Link to post
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.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.