I'm using a text file with hundreds of lines of text and setting that text to display on screen and scroll up slowly. It's basically an interactive reader (using masked circles as spotlights to find the text on the screen). I've been trying to figure out a way to update which string line to add without changing the string lines already added and without having to manually type in a new text command for every string. But for any way I've tried to do a +1 counter for which string to add, the next line of text also changes the previous lines of text. So rather than be able to add line 1, then 2, then 3 and have them all separate on the page, it has 3 separate line 3s on the page. Any suggestions on how I can incrementally change the string without it updating the previous strings?
So I have some code that uses some "lighting" to see through the first layer into the second layer, but I'm having trouble with allowing the user to grab a light. I thought I could set it under the conditional if statement that determines whether the lights move while the mouse is over them, as it functions only on the lights that the mouse is currently over. However, instead, whenever the mouse is pressed, it grabs all the lights. So, what I thought I understood, I don't. How is the first if statement only impacting one light at a time and not the second? How can I grab only one light at a time?
ArrayList <Lighting> works = new ArrayList <Lighting> ();
I'm working on a project in which my ultimate goal is to use spotlights to make text appear on the screen. In evaluating what I do and don't know about processing, I've decided the best way might be to use circles (as the spotlights) that open a hole in the foreground so that the user can see through to the background, and the background would therefore have the text displayed, and the text would only be visible within the circle. I've created the circles, but I'm not quite sure how to layer it, outside of creating a second canvas, and I'm not sure how to setup the circles so that they make the foreground within their diameter transparent. Here's the code I'm working with so far:
ArrayList <Lighting> works = new ArrayList <Lighting> ();
So, you'll have to forgive me, I'm very new to processing, but I'm trying to create a drawing tool that somewhat mimics what a person experiences when using a sharpie pen (or any other sort of pen or marker in which the ink kind of flows on its own). I've got a fairly decent work in progress, but I haven't been able to figure out how to make the circles grow only when the mouse moves over a created circle while the mouse button is clicked (i.e. the ink should only expand when the tip is held to the paper; if the pen is moving, the ink shouldn't expand but should simply draw lines).
Here's the code I'm working with:
int num = 80;
int count = 0;
float mx[] = new float[num];
float my[] = new float[num];
float ms[] = new float[num];
for (int i = 0; i < min(count, num); i++) {
ellipse(mx[i], my[i], ms[i], ms[i]);
ms[i]++;
}
count++;
}
}
}
void mouseReleased() {
count=0;
}
I've tried using the mouseMoved function but it doesn't work like mousePressed and the example in resources doesn't show how to limit its effects for only if the mouse is over the object.