Skip to content

Instantly share code, notes, and snippets.

@rezoner
Last active August 29, 2015 14:18
Show Gist options
  • Save rezoner/f5c1f476329a73c8b895 to your computer and use it in GitHub Desktop.
Save rezoner/f5c1f476329a73c8b895 to your computer and use it in GitHub Desktop.
save screen in playground.js
/* This will make you a screenshot for later usage whenever you want */
ENGINE.Game = {
showOptionsScreen: function() {
app.screenshot = this.app.layer.cache();
app.setState(ENGINE.Options);
}
};
/*
anytime later in the code
use screenshot for cool transitional effects
involving previous screen
or displaying previous screen as a background of current menu
*/
app.layer.drawImage(app.screenshot, 0, 0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment