703
edits
No edit summary |
|||
(4 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
== | == Gestaltungsprogramm 2 == | ||
<source lang="Java">Segmente Objekt1,Objekt2,Objekt3 | <source lang="Java" highlight="26">Segmente Objekt1,Objekt2,Objekt3; | ||
void setup() { | void setup() { | ||
Line 22: | Line 21: | ||
Objekt1.g = 90; Objekt2.g = 90; Objekt3.g = 90; // Richtung nach oben | Objekt1.g = 90; Objekt2.g = 90; Objekt3.g = 90; // Richtung nach oben | ||
Objekt1.h = | Objekt1.h = 50; Objekt2.h = 0; Objekt3.h = 220; | ||
Objekt1.s = 100; Objekt2.s = 100; Objekt3.s = 100; | Objekt1.s = 100; Objekt2.s = 100; Objekt3.s = 100; | ||
Objekt1.b = 100; Objekt2.b = 100; Objekt3.b = 100; | Objekt1.b = 100; Objekt2.b = 100; Objekt3.b = 100; | ||
Objekt1.mouseOver = false; Objekt2.mouseOver = false; Objekt3.mouseOver = false; | Objekt1.mouseOver = false; Objekt2.mouseOver = false; Objekt3.mouseOver = false; | ||
Objekt1. | Objekt1.visible = false; Objekt2.visible = false; Objekt3.visible = false; | ||
} | } | ||
Line 35: | Line 34: | ||
if (keyPressed == true) { | if (keyPressed == true) { | ||
if (key == '1') { | if (key == '1') { | ||
Objekt1. | Objekt1.visible = true; | ||
} | } | ||
if (key == '2') { | if (key == '2') { | ||
Objekt2. | Objekt2.visible = true; | ||
} | } | ||
if (key == '3') { | if (key == '3') { | ||
Objekt3. | Objekt3.visible = true; | ||
} | } | ||
} | } | ||
if (Objekt1. | if (Objekt1.visible == true) { | ||
Objekt1.maleSegmente(); | Objekt1.maleSegmente(); | ||
} | } | ||
if (Objekt2. | if (Objekt2.visible == true) { | ||
Objekt2.maleSegmente(); | Objekt2.maleSegmente(); | ||
} | } | ||
if (Objekt3. | if (Objekt3.visible == true) { | ||
Objekt3.maleSegmente(); | Objekt3.maleSegmente(); | ||
} | } | ||
Line 159: | Line 158: | ||
== Segmente == | == Segmente == | ||
<source lang="Java">class Segmente { | <source lang="Java" highlight="21">class Segmente { | ||
float x; // X-Position | float x; // X-Position | ||
Line 169: | Line 168: | ||
boolean mouseOver; //Maus über dem Objekt | boolean mouseOver; //Maus über dem Objekt | ||
boolean | boolean visible; //Objekt sichtbar | ||
int h,s,b; // Farbe HSB | int h,s,b; // Farbe HSB |
edits