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 & HelpSyntax Questions › Class Recognition
Page Index Toggle Pages: 1
Class Recognition (Read 554 times)
Class Recognition
Mar 12th, 2007, 7:58pm
 
I have been making my project and now I am having to split it into some classes. On one project I got it to work but now applying the exact same code it doesn't work and I have no idea.

I start each class off with:

public class shape extends PApplet{
--code-- }

But when I try and reference the class in my main file it can't find it. Any ideas why?

Thanking in advance
Re: Class Recognition
Reply #1 - Mar 12th, 2007, 8:10pm
 
all you need is:

Code:
class shape
{
}


In fact unless you're doing your progrmming in eclipse, your main code doesn't need to go in any class at all.. in fact it might be better off wihout it:

Code:

int a;

void setup()
{
size(200,200);
}

void draw()
{
background(0);
}

class shape
{
shape()
{
}
}
Page Index Toggle Pages: 1