class StateGraphicsDB { // For seeing the sprites better int emoSize = 15; PImage zoomIn = null; PImage zoomOut = null; // Empty face to re-randomize display PImage pressR = null; // All the color/face combos // branch 0 PImage serenity_face = null; PImage serenity_color = null; PImage joy_face = null; PImage joy_color = null; PImage ecstacy_face = null; PImage ecstacy_color = null; // branch 1 PImage love_face = null; PImage love_color = null; // branch 2 PImage acceptance_face = null; PImage acceptance_color = null; PImage trust_face = null; PImage trust_color = null; PImage admiration_face = null; PImage admiration_color = null; // branch 3 PImage submission_face = null; PImage submission_color = null; // branch 4 PImage apprehension_face = null; PImage apprehension_color = null; PImage fear_face = null; PImage fear_color = null; PImage terror_face = null; PImage terror_color = null; // branch 5 PImage awe_face = null; PImage awe_color = null; // branch 6 PImage distraction_face = null; PImage distraction_color = null; PImage surprise_face = null; PImage surprise_color = null; PImage amazement_face = null; PImage amazement_color = null; // branch 7 PImage disapproval_face = null; PImage disapproval_color = null; // branch 8 PImage pensiveness_face = null; PImage pensiveness_color = null; PImage sadness_face = null; PImage sadness_color = null; PImage grief_face = null; PImage grief_color = null; // branch 9 PImage remorse_face = null; PImage remorse_color = null; // branch 10 PImage boredom_face = null; PImage boredom_color = null; PImage disgust_face = null; PImage disgust_color = null; PImage loathing_face = null; PImage loathing_color = null; // branch 11 PImage contempt_face = null; PImage contempt_color = null; // branch 12 PImage annoyance_face = null; PImage annoyance_color = null; PImage anger_face = null; PImage anger_color = null; PImage rage_face = null; PImage rage_color = null; // branch 13 PImage aggressiveness_face = null; PImage aggressiveness_color = null; // branch 14 PImage interest_face = null; PImage interest_color = null; PImage anticipation_face = null; PImage anticipation_color = null; PImage vigilance_face = null; PImage vigilance_color = null; // branch 15 PImage optimism_face = null; PImage optimism_color = null; void drawState(int branch, int strength, int x, int y) { switch(branch) { case 0: // Joy switch(strength) { case 0: if (serenity_color == null) serenity_color = requestImage("Serenity.png"); if (serenity_face == null) serenity_face = requestImage("002_Serene.png"); image(serenity_color, x, y, emoSize, emoSize); image(serenity_face, x, y, emoSize, emoSize); break; case 1: if (joy_color == null) joy_color = requestImage("Joy.png"); if (joy_face == null) joy_face = requestImage("003_JoyCute.png"); image(joy_color, x, y, emoSize, emoSize); image(joy_face, x, y, emoSize, emoSize); break; case 2: if (ecstacy_color == null) ecstacy_color = requestImage("Ecstacy.png"); if (ecstacy_face == null) ecstacy_face = requestImage("004_Ecstasy.png"); image(ecstacy_color, x, y, emoSize, emoSize); image(ecstacy_face, x, y, emoSize, emoSize); break; } break; case 1: // Love if (love_color == null) love_color = requestImage("Love.png"); if (love_face == null) love_face = requestImage("025_Love.png"); image(love_color, x, y, emoSize, emoSize); image(love_face, x, y, emoSize, emoSize); break; case 2: // Trust switch(strength) { case 0: if (acceptance_color == null) acceptance_color = requestImage("Acceptance.png"); if (acceptance_face == null) acceptance_face = requestImage("021_Acceptance.png"); image(acceptance_color, x, y, emoSize, emoSize); image(acceptance_face, x, y, emoSize, emoSize); break; case 1: if (trust_color == null) trust_color = requestImage("Trust.png"); if (trust_face == null) trust_face = requestImage("022_Trust.png"); image(trust_color, x, y, emoSize, emoSize); image(trust_face, x, y, emoSize, emoSize); break; case 2: if (admiration_color == null) admiration_color = requestImage("Admiration.png"); if (admiration_face == null) admiration_face = requestImage("023_Admiration.png"); image(admiration_color, x, y, emoSize, emoSize); image(admiration_face, x, y, emoSize, emoSize); break; } break; case 3: // Submission if (submission_color == null) submission_color = requestImage("Submission.png"); if (submission_face == null) submission_face = requestImage("017_Submission.png"); image(submission_color, x, y, emoSize, emoSize); image(submission_face, x, y, emoSize, emoSize); break; case 4: // Fear switch(strength) { case 0: if (apprehension_color == null) apprehension_color = requestImage("Apprehension.png"); if (apprehension_face == null) apprehension_face = requestImage("016_Apprehension.png"); image(apprehension_color, x, y, emoSize, emoSize); image(apprehension_face, x, y, emoSize, emoSize); break; case 1: if (fear_color == null) fear_color = requestImage("Fear.png"); if (fear_face == null) fear_face = requestImage("015_Fear.png"); image(fear_color, x, y, emoSize, emoSize); image(fear_face, x, y, emoSize, emoSize); break; case 2: if (terror_color == null) terror_color = requestImage("Terror.png"); if (terror_face == null) terror_face = requestImage("013_Terror.png"); image(terror_color, x, y, emoSize, emoSize); image(terror_face, x, y, emoSize, emoSize); break; } break; case 5: // Awe if (awe_color == null) awe_color = requestImage("Awe.png"); if (awe_face == null) awe_face = requestImage("020_Awe.png"); image(awe_color, x, y, emoSize, emoSize); image(awe_face, x, y, emoSize, emoSize); break; case 6: // Surprise switch(strength) { case 0: if (distraction_color == null) distraction_color = requestImage("Distraction.png"); if (distraction_face == null) distraction_face = requestImage("006_Distraction.png"); image(distraction_color, x, y, emoSize, emoSize); image(distraction_face, x, y, emoSize, emoSize); break; case 1: if (surprise_color == null) surprise_color = requestImage("Surprise.png"); if (surprise_face == null) surprise_face = requestImage("005_Surprise.png"); image(surprise_color, x, y, emoSize, emoSize); image(surprise_face, x, y, emoSize, emoSize); break; case 2: if (amazement_color == null) amazement_color = requestImage("Amazement.png"); if (amazement_face == null) amazement_face = requestImage("014_Amazement.png"); image(amazement_color, x, y, emoSize, emoSize); image(amazement_face, x, y, emoSize, emoSize); break; } break; case 7: // Disapproval if (disapproval_color == null) disapproval_color = requestImage("Disapproval.png"); if (disapproval_face == null) disapproval_face = requestImage("012_Disapproval.png"); image(disapproval_color, x, y, emoSize, emoSize); image(disapproval_face, x, y, emoSize, emoSize); break; case 8: // Sadness switch(strength) { case 0: if (pensiveness_color == null) pensiveness_color = requestImage("Pensiveness.png"); if (pensiveness_face == null) pensiveness_face = requestImage("011_Pensiveness.png"); image(pensiveness_color, x, y, emoSize, emoSize); image(pensiveness_face, x, y, emoSize, emoSize); break; case 1: if (sadness_color == null) sadness_color = requestImage("Sadness.png"); if (sadness_face == null) sadness_face = requestImage("008_Sadness.png"); image(sadness_color, x, y, emoSize, emoSize); image(sadness_face, x, y, emoSize, emoSize); break; case 2: if (grief_color == null) grief_color = requestImage("Grief.png"); if (grief_face == null) grief_face = requestImage("010_Grief.png"); image(grief_color, x, y, emoSize, emoSize); image(grief_face, x, y, emoSize, emoSize); break; } break; case 9: // Remorse if (remorse_color == null) remorse_color = requestImage("Remorse.png"); if (remorse_face == null) remorse_face = requestImage("009_Remorse.png"); image(remorse_color, x, y, emoSize, emoSize); image(remorse_face, x, y, emoSize, emoSize); break; case 10: // Disgust switch(strength) { case 0: if (boredom_color == null) boredom_color = requestImage("Boredom.png"); if (boredom_face == null) boredom_face = requestImage("026_Boredom.png"); image(boredom_color, x, y, emoSize, emoSize); image(boredom_face, x, y, emoSize, emoSize); break; case 1: if (disgust_color == null) disgust_color = requestImage("Disgust.png"); if (disgust_face == null) disgust_face = requestImage("027_Disgust.png"); image(disgust_color, x, y, emoSize, emoSize); image(disgust_face, x, y, emoSize, emoSize); break; case 2: if (loathing_color == null) loathing_color = requestImage("Loathing.png"); if (loathing_face == null) loathing_face = requestImage("028_Loathing.png"); image(loathing_color, x, y, emoSize, emoSize); image(loathing_face, x, y, emoSize, emoSize); break; } break; case 11: // Contempt if (contempt_color == null) contempt_color = requestImage("Contempt.png"); if (contempt_face == null) contempt_face = requestImage("029_Contempt.png"); image(contempt_color, x, y, emoSize, emoSize); image(contempt_face, x, y, emoSize, emoSize); break; case 12: // Anger switch(strength) { case 0: if (annoyance_color == null) annoyance_color = requestImage("Annoyance.png"); if (annoyance_face == null) annoyance_face = requestImage("030_Annoyance.png"); image(annoyance_color, x, y, emoSize, emoSize); image(annoyance_face, x, y, emoSize, emoSize); break; case 1: if (anger_color == null) anger_color = requestImage("Anger.png"); if (anger_face == null) anger_face = requestImage("031_Anger.png"); image(anger_color, x, y, emoSize, emoSize); image(anger_face, x, y, emoSize, emoSize); break; case 2: if (rage_color == null) rage_color = requestImage("Rage.png"); if (rage_face == null) rage_face = requestImage("032_Rage.png"); image(rage_color, x, y, emoSize, emoSize); image(rage_face, x, y, emoSize, emoSize); break; } break; case 13: // Aggressiveness if (aggressiveness_color == null) aggressiveness_color = requestImage("Aggressiveness.png"); if (aggressiveness_face == null) aggressiveness_face = requestImage("001_MildlyEvil.png"); image(aggressiveness_color, x, y, emoSize, emoSize); image(aggressiveness_face, x, y, emoSize, emoSize); break; case 14: // Interest switch(strength) { case 0: if (interest_color == null) interest_color = requestImage("Interest.png"); if (interest_face == null) interest_face = requestImage("007_Interest.png"); image(interest_color, x, y, emoSize, emoSize); image(interest_face, x, y, emoSize, emoSize); break; case 1: if (anticipation_color == null) anticipation_color = requestImage("Anticipation.png"); if (anticipation_face == null) anticipation_face = requestImage("018_Anticipation.png"); image(anticipation_color, x, y, emoSize, emoSize); image(anticipation_face, x, y, emoSize, emoSize); break; case 2: if (vigilance_color == null) vigilance_color = requestImage("Vigilance.png"); if (vigilance_face == null) vigilance_face = requestImage("019_Vigilance.png"); image(vigilance_color, x, y, emoSize, emoSize); image(vigilance_face, x, y, emoSize, emoSize); break; } break; case 15: // Optimism if (optimism_color == null) optimism_color = requestImage("Optimism.png"); if (optimism_face == null) optimism_face = requestImage("024_Optimism.png"); image(optimism_color, x, y, emoSize, emoSize); image(optimism_face, x, y, emoSize, emoSize); break; default: //println("No emotion branch found to draw"); //text("Press r to find a new emotion", x, y); PFont font; // The font must be located in the sketch's // "data" directory to load successfully font = loadFont("Gisha-Bold-32.vlw"); textFont(font); fill(0, 0, 0); if (pressR == null) pressR = requestImage("PressR.png"); text("To Reset", x-30, y+40+emoSize); image(pressR, x, y, emoSize, emoSize); break; } } void drawZoom() { PFont font; // The font must be located in the sketch's // "data" directory to load successfully font = loadFont("Gisha-Bold-32.vlw"); if (zoomIn == null) zoomIn = requestImage("ZoomIn.png"); if (zoomOut == null) zoomOut = requestImage("ZoomOut.png"); textFont(font); fill(0, 0, 0); text("To Zoom...", 10, 40); image(zoomOut, 20, 50); image(zoomIn, 40, 50); } }