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 & HelpPrograms › Creating multiple classes.
Page Index Toggle Pages: 1
Creating multiple classes. (Read 929 times)
Creating multiple classes.
Nov 24th, 2009, 7:47am
 
Hi all. I'm quite new to using processing. We managed to create some code which displays different images from the 'data' folder and then does different features.

The processing file is called Images_25, so when it is exported as a Java file, the main parent class is called Images_25.

We're trying to create it so that the user clicks a button it loads a different class of Images_25.

For example, we have a screen which displays a set of images and then when the user clicks an arrow button, it loads a new set of images.

Thanks.
Re: Creating multiple classes.
Reply #1 - Nov 24th, 2009, 8:14am
 
I don't think you should load a different class, which basically would be the same with different parameters.
You should build the functionality you describe in your class/sketch, adding some features to improve flexibility, like reading a list of images, perhaps grouped by screen, from some file (plain text or XML), etc.
Re: Creating multiple classes.
Reply #2 - Nov 24th, 2009, 8:22am
 
But if we have an array which displays some images using XML, then how do we go about setting it so that it loads another array set?
Re: Creating multiple classes.
Reply #3 - Nov 24th, 2009, 11:15am
 
Hard to answer without details about your application, but the idea is to load settings, basically a bunch of file names, grouped by screen.
On user action, you load the image files whose names are in the next group.
Page Index Toggle Pages: 1