This is my first post here, so far - thank you for this wonderful community! I do tend to spend a lot of time here and find a lot of the answers around :) However, I seem to have troubles finding the answer of this specific question, and with my thesis submission knocking on the door I'm getting kinda desperate :)
Here it goes:
I am trying to get a few sketches stick together into a linear flow style application. The way I imagine it is the following:
First screen_first;
Second screen_second;
int stage = 0;
void setup()
{
size(860, 600);
colorMode(HSB, 360, 100, 100);
smooth();
screen_first = new First();
screen_second = new Second();
}
void draw()
{
background(0);
switch(stage)
{
case 0:
screen_first.draw();
break;
case 1:
screen_second.draw();
break;
}
}
void mousePressed()
{
stage++;
if (stage == 2) stage = 0;
}
class First
{
First()
{
size(860, 600);
colorMode(HSB, 360, 100, 100);
smooth();
}
void draw()
{
background(240, 40, 40);
fill(300,100,90);
rect(20,20,100,100);
}
}
class Second
{
Second()
{
size(860, 600);
colorMode(HSB, 360, 100, 100);
smooth();
}
void draw()
{
background(50, 80, 40);
fill(100,90,90);
rect(50,120,200,200);
}
}
Now, I did my research here first - there seems to be a lot of ways to accomplish the task using extra frames, but that's not what I would like to use if possible. The idea is that there is no main control screen, but rather toggling (linearly switching to) 4 sketches (that I am working on separately right now).
If I am conceptually wrong about this, please do advise me to what a better workflow might be.