views:

34

answers:

1

According to the Processing Reference, stroke(gray, alpha) allows to set the color and opacity of the stroke. With the default color mode, an alpha value of 255 denotes full opacity, while a value of 0 should correspond to complete transparency. While this works with the (default) JAVA2D renderer, I can't seem to paint fully transparent points in P2D mode.

This code clearly renders a pixel at the center of the canvas, even though the alpha value is set to 0 (fully transparent):

public class Transparency extends PApplet {

    @Override
    public void setup() {
        size(200, 200, P2D);
    }

    @Override
    public void draw() {
        stroke(0, 0);
        point(width / 2, height / 2);
    }

    public static void main(String[] args) {
        PApplet.main(new String[] { Transparency.class.getSimpleName() });
    }

}

What's wrong here?

A: 

This is a processing bug. For now the only thing you can do is check the transparency yourself, and don't draw if it's zero

Nathan
I try to approach problems based on the "SELECT is not broken" idiom (http://bit.ly/U5c5L) but I will happily accept your answer if you can provide a Bug ID or a link to any other official reference -- TIA!
netzwerg