diff --git a/src/core/Runner.js b/src/core/Runner.js index 8d1ce16..efd3e3e 100644 --- a/src/core/Runner.js +++ b/src/core/Runner.js @@ -158,7 +158,7 @@ var Common = require('./Common'); && engine.render && engine.render.controller && engine.render.controller.clear) { - engine.render.controller.clear(engine.render); + engine.render.controller.clear(engine.render); // @deprecated } // update diff --git a/src/render/RenderPixi.js b/src/render/RenderPixi.js index 518e8eb..79beccc 100644 --- a/src/render/RenderPixi.js +++ b/src/render/RenderPixi.js @@ -13,6 +13,7 @@ module.exports = RenderPixi; var Composite = require('../body/Composite'); var Common = require('../core/Common'); +var Events = require('../core/Events'); (function() { @@ -98,6 +99,11 @@ var Common = require('../core/Common'); } }; + // event listeners + Events.on(render.engine, 'beforeUpdate', function() { + RenderPixi.clear(render); + }); + // caches render.textures = {}; render.sprites = {};