We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello, I am trying to make a simple line drawing application, where a line is drawn from one number (from an OSC program) to another, while a toggle button is pushed. I am wondering if there is a way to change the strokeWeight for lines I have already drawn. So, if a line is drawn (which I realize is a series of points to points) with strokeWeight(1), I could then go back and change the thickness (strokeWeight()) of that specific line.
The ultimate goal is to get the thickness of lines to change to music frequencies (like a graphic eq). I have the eq numbers, now I just need to be able to change the line thickness. Thanks
Answers
hello,
you would need to store the lines in an arraylist and draw them from there.
To draw a new line, it is stored in the arraylist. To update the screen use background(0); and then draw the complete arraylist to the screen, either with a global strokeWeight for all or each strokeWeight individually.
To do so, you could make a class Line and have an arraylist of type Line. (all pseudocode, more or less) [edited]
in draw ()
Greetings, Chrisir
this is the idea:
real code...
Thank you so much. I knew an array was the answer but this is the guidance I needed to get started. I will let you know what I come up with, thanks again!
Great!