Hi, I’m simply drawing lines for a schematic program using PShapes, and I want some visual indication when lines cross. I’d like to do this by controlling the transparency of the PShape lines so that a crossing would show darker at the at location.
I’ve looked at a lot of threads, talking about tints, alpha, etc, but nothing is what I’m looking for or I’m missing something simple.
Hi Chrisir,
It’s not very exciting code, I’ll just post a fragment here. As the user draws, it adds sections to the “hose” in grey, then when done, it turns blue.
void addHose(int lastX, lastY, endY){
hose = createShape(LINE,lastX, lastY, lastX, endY);
hose.setStroke(128); // draw in gray as hoses are added
hose.setStrokeWeight(10.0);
hoseGroup.addChild(hose);
hosepart++;
created = true;
}
void finish(){
hoseGroup.disableStyle();
stroke(0,0,150); // draw in blue once completed all hosesstrokeWeight(10);
shape(hoseGroup);
}