Mike018 Posted June 3, 2017 Share Posted June 3, 2017 I have a gradient background in every state, which will eventually crash the game on mobile through X number of state switches. How do you properly re-use large bitmaps, because I tried to kill() the circle upon shutdown but I guess that just works on sprites. let bmd = this.game.make.bitmapData(this.game.width, this.game.height); bmd.addToWorld(); let outerCircle = new Phaser.Circle(this.game.world.centerX, this.game.world.centerY, this.game.height); let grd = bmd.context.createRadialGradient(this.game.world.centerX, this.game.world.centerY, 0, outerCircle.x, outerCircle.y, outerCircle.radius / 1.4); grd.addColorStop(0, '#46435D'); // inner grd.addColorStop(1, '#252333'); // outer bmd.cls(); bmd.circle(outerCircle.x, outerCircle.y, outerCircle.radius, grd); Link to comment Share on other sites More sharing options...
samme Posted June 3, 2017 Share Posted June 3, 2017 Think you need bmd.destroy(); during shutdown. Mike018 1 Link to comment Share on other sites More sharing options...
Recommended Posts