if (foreground) {
for (int i = 0; i < elements.size(); i++) {
ElementBase element = elements.get(i);
if (element.isVisible()) {
element.drawForeground(mouseX, mouseY);
}
}
} else {
for (int i = 0; i < elements.size(); i++) {
ElementBase element = elements.get(i);