How do i save my game's ending as image?
Hi
I have a game I'm making in Animate CC (HTML5 canvas), and would like to have a button so the gamer can save their current progress as an image. How do I do that?
Thank you in advance ![]()
Hi
I have a game I'm making in Animate CC (HTML5 canvas), and would like to have a button so the gamer can save their current progress as an image. How do I do that?
Thank you in advance ![]()
You can use the following code for Html Canvas documents. Say, you wish to capture the last frame of your animation; just paste the following code in the last frame:
this.stop();
var aTag = document.createElement('a');
aTag.setAttribute('href', canvas.toDataURL("image/png"));
aTag.innerHTML = "Download Screenshot";
aTag.download = "YourScreenshot.png";
document.body.appendChild(aTag);
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.