We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpIntegration › help, first timer, trying to put processing on web
Page Index Toggle Pages: 1
help, first timer, trying to put processing on web (Read 1246 times)
help, first timer, trying to put processing on web
Aug 18th, 2009, 1:01pm
 
i made a simple processing code, that draw a line segment. i want to use the code on a webpage.

i did the export from the file menu, but when i open the html  file it created it say "Start: applet not initialized" at the bottom, and nothing shows up but a blank box.

what do I do?

this is the code

Code:

PFont fontA;

int Ax = int(random(20,280));
int Ay = int(random(20,80));
int Cx,Cy,Bx,By;
float lineSize;

void setup()
{
 size(300, 100);
 smooth();
 fontA = loadFont("CourierNew36.vlw");
 textFont(fontA, 25);
     
 for (int i = 0; i < 300; i++) {
   Bx = int(random(20,280));
     By = int(random(20,80));
   if ((Ax-Bx)*(Ax-Bx) + (Ay-By)*(Ay-By) > 100*100){
     i=2000;
   }
 }
 lineSize=(Ax-Bx)*(Ax-Bx) + (Ay-By)*(Ay-By);
 Cx = (Ax+Bx)/2;
 Cy = (Ay+By)/2;

 // Only draw once
 noLoop();
}

void draw()
{

fill(0);    
       
     text('A', Ax, Ay);
     text('B', Bx, By);
     text('C', Cx, Cy);
     line(Ax,Ay,Bx,By);
}

Re: help, first timer, trying to put processing on web
Reply #1 - Aug 18th, 2009, 1:21pm
 
> (Ax-Bx)*(Ax-Bx) + (Ay-By)*(Ay-By)

http://processing.org/reference/dist_.html
Re: help, first timer, trying to put processing on web
Reply #2 - Aug 19th, 2009, 1:20am
 
> i=2000;

Replace with break

Both answers are not relevant to your problem... Smiley

What system, browser How do you open the page Where is the jar file
Page Index Toggle Pages: 1