Actually I generate a texture from that code and apply that to an image.
let g = scene.add.graphics().lineStyle(1, 0x000000);
g.defaultFillAlpha = 0.3;
g.defaultFillColor = 0xFFFFFF;
//g.fillRect(0, 0, 32, 20);
g.strokeRect(0, 0, 32, 20);
This code does draw a black rectangle outline, just as I would expect.
(The lineStyle values are the default values as far as I understand it, setting them explicitly shouldn’t make a difference.)
However, as soon as I uncomment g.fillRect(...), the whole thing becomes solid black. Does that somehow make sense? The color is explicitly set to white and alpha to 0.3. So why is it going black?
I can’t help but think that there is something wrong with fillRect.
Interestingly, if I reverse the colors, thus drawing the rectangle outline white and the fill rect black, the white rectangle is drawn above the black filled rectangle. The alpha value is still ignored though.