[SOLVED] Change display of a line depending on a flag
in
Programming Questions
•
4 months ago
Hi everybody, I apologize for my low english
In my draw() part, i put something like this :
if (flag_1 == true)
{
line(600,225,600,187);
}
else
{
line(600,225,600,255);
}
I have created a toggle button in order to change that flag value and i want this line to be in one place at a time.
Unfortunately when i toggle the previous line stays in the drawing.
I've seen we can fix this by generating the background in the draw, but most of my drawing is generated in the setup() so this wont always load my draw at everyframe.
Someone has an idea for this line?
Thank you so much for reading
In my draw() part, i put something like this :
if (flag_1 == true)
{
line(600,225,600,187);
}
else
{
line(600,225,600,255);
}
I have created a toggle button in order to change that flag value and i want this line to be in one place at a time.
Unfortunately when i toggle the previous line stays in the drawing.
I've seen we can fix this by generating the background in the draw, but most of my drawing is generated in the setup() so this wont always load my draw at everyframe.
Someone has an idea for this line?
Thank you so much for reading
1