I have a problem with processing and eclipse when running in OpenGL, the window when running in application mode the processing window is not centred on screen. All the interactions are centered though. I am running on a MacBook Pro 13" with intel HD4000. It has worked before and I have not updated anything as far as I know.... Here are some sample code:
I have a question regarding how array works. I will attch a small piece of sample code so you can see what I mean.
The first case is this, in a small processing application, I declare a float array named data. I pass that float array into the function loadData which returns a float array. The returned data is of correct length and with the correct values. So far so good.
float[] data;
public void setup()
{
data = chartData.loadData("oc", loadFileGdp);
}
But how does it work when I have a two dimensional array named data instead of a one dimensional? Like this example:
I cannot get this to work, I know there are many workarounds that I can take to make it work, but I am interested to why this is wrong, to me it seems pretty logical.
Thank you very much for your help & many thanks to the processing team!
I have searched for this for quite a while now, but I have not really reached any answers about how to do this. I am working with an XML-file that is tagged in indesign. It is basically just alot of text with a few words here and there that are tagged. The basic structure is like this:
<?xml version="1.0"?>
<root>
<text>Hello, My name is <name>Mariel</name> and I am an excellent dancer. Just as good as the more famous <name >Mariel</name> who stole my name.</text>
</root>
what I want to do is exchange the words within the <name> tags with something else. The text I am working on is quite large and there are maybe fifty different tags that needs to be recognized and changed (many tags like <name> show up in different parts of the text). So i need some kind of system for it.
I have managed to load the xml file and put the contents of the tags in an String-array and change it like how i want to have it. But I dont know who to write it back to an xml file? What would you guys do if you were facing the same problem?
I have two classes that I work with Button and Scrollbar. But my problem is general. From the Button class I want to be able to call the ornage marked method above. How do I do this? Do I have to use a static method? I will attach the button class aswell below so you can see it:
import processing.core.PApplet;
public class Button
{
int x, y; // The x- and y-coordinates
int size; // Dimension (width and height)
int baseGray; // Default gray value
int overGray; // Value when mouse is over the button
int pressGray; // Value when mouse is over and pressed
boolean over = false; // True when the mouse is over
boolean pressed = false; // True when the mouse is over and pressed
boolean circleRect = false; //True when circle, False when rectangle
PApplet parent;
Button(PApplet q, boolean cR, int xp, int yp, int s, int b, int o, int p)