make strokeWeight only affect one object/class?
in
Programming Questions
•
2 years ago
Hi
I'm coding a large project that has many different shapes on the sketch that react differently to varying OSC messages.
I now wish to add a simple line (that will but a line through one of the shapes) which I can make appear and disappear with a simple boolean statement over OSC.
I have defined the class as:
class Mute1
{
float X1;
float X2;
float Y1;
float Y2;
Mute1(float tempX1, float tempY1, float tempX2, float tempY2)
{
X1 = tempX1;
Y1 = tempY1;
X2 = tempX2;
Y2 = tempY2;
}
void display ()
{
if (MU1 == 1)
{
strokeWeight(50);
line(X1,Y1,X2,Y2);
}
else
strokeWeight(0);
}
}
However, when I then communicate with the sketch the following occurs:
MU1 ==1
Line appears as expected on sketch, all shapes on sketch become smaller (presumably in relation to strokeWeight)
MU1 ==0
Line Disappears and all shapes return to original size
So as far as I understand, strokeWeight must be affecting all pixel widths? Is it intended for this purpose. I would have thought seeing as I had declared it in a class outside of the main code it would not affect other objects?
1