PabloK Posted April 6, 2016 Share Posted April 6, 2016 Hi I'm trying to make a basic lightning system using bitmap multiply. How ever I'm having trouble with the fact that the bitmap does not darken my sprites. How would I achieve this? I create the bitmap like so in the game.create function. // Shadow this.bitmap = this.game.add.bitmapData( this.game.width+100, this.game.height+100 ); this.lightBitmap = this.game.add.image(0, 0, this.bitmap); this.lightBitmap.blendMode = Phaser.blendModes.MULTIPLY; I then fill it and paint it every frame in the update function. this.bitmap.fill(20, 20, 20, 1); this.lightBitmap.x = this.camera.x-50; this.lightBitmap.y = this.camera.y-50; this.bitmap.dirty = true; Here is an image that shows what happens. I painted the shadow on half screen only to illustrate that it does not darken the sprites. The dirt tiles and the purple player are the sprites I want it to affect. How can I make it darken the sprites as well? Link to comment Share on other sites More sharing options...
drhayes Posted April 6, 2016 Share Posted April 6, 2016 Is that lightBitmap the last thing you added, so that it's "on top" of everything else? Since you're using blend modes, are you running in WebGL? Link to comment Share on other sites More sharing options...
PabloK Posted April 6, 2016 Author Share Posted April 6, 2016 Yupp that was the problem got an answer here before. http://stackoverflow.com/questions/36441069/phaser-bitmap-multiply-does-not-affect-sprites/36445056#36445056 Link to comment Share on other sites More sharing options...
Recommended Posts