FAQ
Cover
This is the archive Discourse for the Processing (ALPHA) software.
Please visit the new Processing forum for current information.

   Processing 1.0 _ALPHA_
   Discussion
   General Processing Discussion
(Moderators: fry, REAS)
   Why I can't get it to run?
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: Why I can't get it to run?  (Read 317 times)
meiy

mei_yu89
Why I can't get it to run?
« on: Mar 21st, 2004, 10:47pm »

Hello,
I am new for processing and don't have programming background either, can someone help me?
I just down load Processing and can open the app, but when I copy and paste the one of the example's source code into the P5 window, and hit run, it only showing a blank screen with red "X" on the top left, I did installed JVM, and I can view the examples from this site, so what else I missed here?
the code I copy/paste to the P5 window are here:  
 
// Kinetic Type  
// by Zach Lieberman <http://www.thesystemis.com>  
 
Line ln;  
Line lns[];  
BFont f;  
String words[] = {  
  "sometimes it's like", "the lines of text", "are so happy", "that they want to dance",  
  "or leave the page or jump", "can you blame them?", "living on the page like that",  
  "waiting to be read..."  
};  
 
void setup()  
{  
  size(200, 200);  
  framerate(30);  
 
  // array of line objects  
  lns = new Line[8];  
 
  // load the font. fonts are located within the  
  // main Processing directory/folder and they  
  // must be placed within the data directory  
  // of your sketch for them to load  
  f = loadFont("Univers66.vlw.gz");  
  textFont(f, 1f);  
 
  // white type, black background  
  fill(255);  
 
  // creating the line objects  
  for(int i = 0; i < 8; i++)  
  {  
    // for every line in the array, create a Line object to animate  
    // i * 70 is the spacing  
    ln = new Line(words[i], 0, i * 70, f);  
    lns[i] = ln;  
  }  
}  
 
void loop()  
{  
  background(0);  
  
  translate((float)(width / 2.0) - 350, (height / 2.0) - 240, -450);  
  rotateY(0.3);  
 
  // now animate every line object & draw it...  
  for(int i = 0; i < 8; i++)  
  {  
    float f1 = sin((i + 1.0) * (millis() / 10000.0) * TWO_PI);  
    float f2 = sin((8.0 - i) * (millis() / 10000.0) * TWO_PI);  
    Line line = lns[i];  
    push();  
    translate(0.0, line.yPosition, 0.0);  
    for(int j = 0; j < line.myLetters.length; j++)  
    {  
      if(j != 0)  
      translate(f.width(line.myLetters[j - 1].myChar) * 75, 0.0, 0.0);  
      rotateY(f1 * 0.035 * f2);  
      push();  
      scale(75.0, 75.0, 75.0);  
      text(line.myLetters[j].myChar, 0.0, 0.0);  
      pop();  
    }  
    pop();  
  }  
}  
 
class Letter  
{  
  char myChar;  
  float x;  
  float y;  
  
  Letter(char c, float f, float f1)  
  {  
    myChar = c;  
    x = f;  
    y = f1;  
  }  
}  
 
class Word  
{  
  String myName;  
  int x;  
  
  Word(String s)  
  {  
    myName = s;  
  }  
}  
 
class Line  
{  
  String myString;  
  int xPosition;  
  int yPosition;  
  int highlightNum;  
  BFont f;  
  float speed;  
  float curlInX;  
  Letter myLetters[];  
  
  Line(String s, int i, int j, BFont bagelfont)  
  {  
    myString = s;  
    xPosition = i;  
    yPosition = j;  
    f = bagelfont;  
    myLetters = new Letter[s.length()];  
    float f1 = 0.0F;  
    for(int k = 0; k < s.length(); k++)  
    {  
      char c = s.charAt(k);  
      f1 += bagelfont.width(c);  
      Letter letter = new Letter(c, f1, 0.0);  
      myLetters[k] = letter;  
    }  
 
    curlInX = 0.1;  
  }  
}  
 
« Last Edit: Mar 21st, 2004, 10:48pm by meiy »  
fry


WWW
Re: Why I can't get it to run?
« Reply #1 on: Mar 21st, 2004, 11:03pm »

perhaps you're making it too difficult for yourself.. this example you needn't even copy & paste, it's included with processing itself. just click the 'open' button, then go to examples, then "typography", then select "kinetic_type".  
 
next, hit the 'run' button to make the example start, or hit 'export' if you want it to make an applet that you can run from a web page.  
 
good luck
 
meiy

mei_yu89
Re: Why I can't get it to run?
« Reply #2 on: Mar 28th, 2004, 3:42am »

Great! It worked!
Thanks
 
Pages: 1 

« Previous topic | Next topic »