Hello Im trying to make a alpha gradient mask - as mirror (openfl)
var data:BitmapData = new BitmapData(Std.int(object.width), Std.int(object.height), true, 0);
data.draw(object);
var bit:Bitmap = new Bitmap(data, PixelSnapping.NEVER, true);
holder.addChild(bit);
var m:Matrix = new Matrix();
m.createGradientBox(bit.width, h, Math.PI / 2);
var msk:Shape = new Shape();
msk.graphics.beginGradientFill("linear", [0xEEEEEE, 0xEEEEEE], [1, 0], [0, 200], m);
msk.graphics.drawRect(0, 0, bit.width, h);
msk.graphics.endFill();
msk.y = object.y + h + distance;
msk.x = object.x;
msk.cacheAsBitmap = true;
bit.cacheAsBitmap = true;
bit.mask = msk;
No alpha applied if i test it without masking - the gradient looks great…