Skip to content

Instantly share code, notes, and snippets.

@InternetExplorer
Created April 3, 2012 14:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save InternetExplorer/2292647 to your computer and use it in GitHub Desktop.
Save InternetExplorer/2292647 to your computer and use it in GitHub Desktop.
Linking Impact and EaselJS Drawing
// Impact's main draw function in the main game file
draw: function() {
// Clear out the main canvas since Easel will have drawn things that Impact doesn’t know about
var ctx = ig.system.context;
ctx.setTransform(1, 0, 0, 1, 0, 0);
ctx.clearRect(0, 0, ig.system.width, ig.system.height);
// Call draw on the parent object to make sure that all draws to the canvas are finalized
// before telling Easel to update
this.parent();
// Calls tick on our SystemManager object, which is the main EaselJS code
// that handles drawing the non-gameplay elements of Bored To Death
SystemManager.tick();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment