Created
April 3, 2012 14:54
-
-
Save InternetExplorer/2292647 to your computer and use it in GitHub Desktop.
Linking Impact and EaselJS Drawing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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