wordyAllen Posted January 13, 2016 Share Posted January 13, 2016 Hello, I'm trying to render a dynamic bitmap shadow, similar to this example: http://phaser.io/examples/v2/text/dynamic-text-shadow I'm trying to replicate it using the shadow method: http://phaser.io/docs/2.4.1/Phaser.BitmapData.html#shadow Here's what I have (I think the problem is on line 44): http://codepen.io/wordyallen/pen/jWLmGV I guess my question is, how do you update BitmapData ? Any help is appreciated. Thanks! Link to comment Share on other sites More sharing options...
wordyAllen Posted January 13, 2016 Author Share Posted January 13, 2016 I got it! (well dr.hayes in the salck channel got it) In case anyone want to add dynamic shadows to your images.... you have to redraw the bmd in update() . check the codepen for an example. function update () { offset = moveToXY(game.input.activePointer, sprite.x, sprite.y, 8); bmd.clear(); bmd.shadow('rgba(0, 0, 0, 0.5)', 5, offset.x, offset.y); bmd.copy('shape') } Tilde 1 Link to comment Share on other sites More sharing options...
Recommended Posts