Make a class, called something like movingText. The class will have 3 member variables; x,y for position and a String to hold the actual text.
See: http://processing.org/reference/class.html
Code:
class movingText {
float x, y;
String s;
movingText (float _x, float _y, String _text) {
//This function is the 'constructor'.
//It will get called when you create a new
//movingText object
x = _x; //Set x to the first argument
y = _y; //Set y to the second argument
s = _text; //Set our string to the 3rd argument
}
void drawText() {
//Place code to actually draw the text here.
// see : http://processing.org/reference/text_.html
}
// Now, two methods to change the x&y variables
void move_y(float amount){
y+=amount;
}
void move_x(float amount){
x+=amount;
}
}
Then you need the main program structure:
Code:
movingText myText; //Create an object "myText" using the new class
void setup(){
size(500,500,P3D);
myText=new movingText(250,250,"processing rules"); //call the constructor
}
void draw(){
myText.drawText(); // draw the text on every frame
}
void keyPressed(){
//This function is called when any key is pressed
// if A is pressed, call myText.moveY(-1); etc..
// see: http://processing.org/reference/keyPressed_.html
// and: http://processing.org/reference/key.html
}
You will need to create a font (using the Processing IDE) and add code for loading the font.
Always use the reference section! : http://processing.org/reference/index_ext.html
The processing documentation is unbeatable, and loaded with examples. Good luck!