We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpPrograms › Lines disappear with controlp5 event...
Page Index Toggle Pages: 1
Lines disappear with controlp5 event... (Read 688 times)
Lines disappear with controlp5 event...
May 2nd, 2010, 2:27pm
 
To see the line, I have specify noLoop() in draw(), but adding redraw() to functions doesn't help either.

As soon as a cause an event in my program, the line vanishes.

I'm not sure if something is being drawn over it or what's going on.


Code:
void draw() {
background(128);

for (int i = 0 ; i < 9; i++) {
nodes[i].draw();
// println(nodes[i].count);
}

strokeWeight(4);
smooth();
line((width/5 + .1 * .78*width), height - 40, (width/5 + .8 * .78*width), height*.4);

noLoop();
}


Re: Lines disappear with controlp5 event...
Reply #1 - May 2nd, 2010, 3:53pm
 
If you search the forum for noLoop() you'll find lots of questions like this...  There aren't that many situations in which you'd want to use it and it's likely that the solution is to find an alternative approach to achieving what you want.  Often it's simply a matter of using a boolean to control when something does or does not appear...  So if I've understood correctly your intention you'd simply set a boolean to true when you want the line to appear and wrap the line() in a test against the boolean...
Page Index Toggle Pages: 1