Rendering a different PShape based on key input?
in
Programming Questions
•
11 months ago
I am trying to make key input determine which .svg file is rendered. Here is my code:
- void setup() {
- size (600, 600);
- background (255, 255, 255);
- }
- void draw() {
- background (255,255,255);
- PShape a, b, c, d, e, f, g, h;
- a = loadShape("A.svg");
- b = loadShape("B.svg");
- c = loadShape("C.svg");
- d = loadShape("D.svg");
- e = loadShape("E.svg");
- f = loadShape("F.svg");
- g = loadShape("G.svg");
- h = loadShape("H.svg");
- // etc.
- shape(key, 0, 10, 200, 200);
- }
I also tried converting key to an integer and a float, and neither of those worked either.
I am pretty new to Processing and programming in general...
1