My background image is loading correctly. However, the overlay elements above the background image is not appearing.
These are the overlay elements not appearing: Draw overlay, Draw Agent, Agent, Draw agents with dynamic colors, agentAlpha, strokeWidth, drawMode, overlayAlpha, noiseStrength, noiseScale, agentCount.
Your help would be much appreciated.
PImage backgroundImage;
int agentCount = 200;
Agent[] agents = new Agent[agentCount];
float noiseScale = 200;
float noiseStrength = 15;
int overlayAlpha = 100;
int agentAlpha = 90;
float strokeWidth = 2.0;
int drawMode = 40;
backgroundImage = loadImage("800x800-bg.jpg");
backgroundImage.resize(width, height);
for (int i = 0; i < agentCount; i++) {
agents[i] = new Agent();
}
if (saveFrames) {
saveFrames();
}
}
void draw() {
// Draw agents with dynamic colors
for (int i = 0; i < agentCount; i++) {
float hue = map(i, 0, agentCount, 0, 200); // Assign a unique hue to each agent
stroke(hue, 100, 180, agentAlpha);
if (drawMode == 1)
agents[i].update1(noiseScale, noiseStrength, strokeWidth);
else
agents[i].update2(noiseScale, noiseStrength, strokeWidth);
}
// Draw overlay
fill(overlayAlpha);
noStroke();
rect(20, 23, width, height);
// Draw background image last
image(backgroundImage, 0, 0);
}