Hello all. With the help of this forum, I was able to create the first version of my queue manager, One small problem: After 11 names are entered, the names go off screen. I tried to fix it by making another array, making a function to change the X position of the text(), all with no luck.
Here is my code:
int nameStat = 1;
boolean loopStat = false;
int XPos = 20;
int loop = 0;
int s = 0;
int i = 0;
String currentName = "";
int z = i + 1;
String names[] = new String[30];
boolean startupStatus = false;
int numFrames = 166;
PImage[] images = new PImage[numFrames];
int currentFrame = 0;
void setup() {
imageMode(CENTER);
size(900, 650);
String letter = "";
for (int i = 0; i < 11; i++) names[i] = letter;
for (int i = 0; i < images.length; i++) {
//String imageName = "frame" + nf(i, 4) + ".png";
//Load images
//images[i] = loadImage(imageName);
}
frameRate(29.997);
}
void draw() {
background(0);
if (startupStatus == false) {
//image(images[currentFrame], width / 2, height / 2);
currentFrame++; //Next Frame
text("Initializing... TechMaster Industries ServiceTicketManager VbGUI1.3.2", 10, 10);
if (s>=100) {
text("Starting Services", 10, 25);
}
if (s >=175) {
text("Acquiring Canadian Cirizenship", 10, 40);
}
if (s >=185) {
text("Error: Trump's Wall is blocking Signal", 10, 55);
}
if (s >= 200) {
text("Loading KeyGen Detector", 10, 70);
}
if (s >= 220) {
text("KeyGen Test Passed", 10, 85);
}
if (s >=225) {
text("Loading Vectors", 10, 100);
}
if (s >= 232) {
text("Loading Sprites", 10, 115);
}
if (s >= 240) {
text("Loading Sprites", 10, 130);
}
if (s >=245) {
text("Loading AI bash scripts", 10, 145);
}
if (s >=300) {
text("Loading Kernel ROM", 10, 160);
}
if (s >=325) {
text("Loading TechMasterOS", 10, 175);
}
if (s >= 400) {
text("Loading Rick Astley", 10, 190);
}
if (s >= 420) {
text("Loading Batch Programs", 10, 205);
}
if (s >= 450) {
text("Extracting TechMaster Files", 10, 220);
}
if (s >= 500) {
text("Extraction Complete", 10, 235);
}
if (s >= 505) {
text("Downloading More RAM", 10, 260);
}
if (s >= 515) {
text("Pirating Adobe Creative Cloud", 10, 275);
}
if (s >= 530) {
text("Getting Board Yet?", 10, 290);
}
if (s >= 600) {
text("Extracting Kevin McCallister", 10, 305);
}
if (s >= 650) {
text("Alerting Kevin's Mom", 10, 320);
}
if (s >= 680) {
text("KEVIN!", 10, 335);
}
if (s >= 700) {
text("U forgot a semi colon", 10, 350);
}
if (s >= 750) {
text("Hi! I'm Cortana", 10, 375);
}
if (s >= 790) {
text("Checking Activation status with Activation Server", 10, 390);
}
if (s>=800) {
text("Activation Succesful. Welcome to TechMaster", 10, 405);
}
s++;
if (currentFrame == images.length && loopStat == false) {
currentFrame = 0;
loopStat = true;
}
if (currentFrame == images.length) {
if (loop == 3) {
background(0);
delay(1000);
startupStatus = true;
currentName = "";
} else {
loop++;
currentFrame = 0;
print(loop);
}
}
}
if (startupStatus == true) {
background(0);
textAlign(CENTER);
textSize(22);
text("Welcome to the TechMaster Industries TechHelp Desk Please type in your \n name followed by ENTER to reserve a spot in the queue", 450, 50);
textSize(25);
text(currentName, 450, 160);
textAlign(LEFT);
text("Current Queue (Estimated Wait Time:" + i * 5 + " Minutes)", 10, 250);
textSize(20);
for (int i = 0; i < 11; i++) {
if (names[i] != null ) {
text(names[i], 20, 300 + i * 35);
}
}
}
z = i + 1;
if (i < 0) {
i=0;
}
}
void keyPressed() {
if (key == CODED) {
if (keyCode == UP) {
names = reverse(names);
names = shorten(names);
names = reverse(names);
//names = shorten(names);
i--;
} else if (keyCode == DOWN) {
s = 800;
loop = 3;
}
}
if (key == BACKSPACE) {
currentName = currentName.substring(0, max(0, currentName.length() - 1));
} else if (key == ENTER) {
names[i] = currentName;
currentName = "";
i = i + 1;
} else {
currentName += key;
}
}
(You can press the DOWN arrow key to skip the nonsense at the beginning, and UP arrow key to remove names)
(The commented image code is for an animation I displayed at the beginning, I donāt think itās gonna be easy to host these images and have people download them, so I just removed them entirely)
Basically, Iām trying to get it so that after 11 names, the list moves x pixels to the right so that more names can be displayed
Thanks in advance