Tembac you are calling super.draw() first in draw() function of Playstate. Call this after processing light and updating graphics like this:
override public function draw():Void
{
ligth.setPosition(FlxG.mouse.x - ligth.width * .5, FlxG.mouse.y - ligth.height * .5);
var gfx:Graphics = FlxSpriteUtil.flashGfxSprite.graphics;
gfx.clear();
darknessCanvas.pixels.fillRect(new Rectangle(0, 0, FlxG.width, FlxG.height), 0xff000000);
FlxSpriteUtil.updateSpriteGraphic(darknessCanvas);
super.draw();
}
By the way, this process is very slow in mobile target, as stamping function is not hardware accelerated, for a single light you wont notice, but for many lights its gonna be slow.
On Wednesday, December 24, 2014 2:28:47 AM UTC+6, Tembac wrote: