andere teile
This commit is contained in:
parent
e838a83cb4
commit
cd995cd5f3
@ -225,6 +225,41 @@ void mousePressed() {
|
|||||||
}
|
}
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
** Datentypen
|
||||||
|
*** Mausposition ausgeben
|
||||||
|
#+begin_src processing
|
||||||
|
void setup(){
|
||||||
|
size(200, 200);
|
||||||
|
}
|
||||||
|
void draw(){
|
||||||
|
println("x=" + mouseX, "y=" + mouseY);
|
||||||
|
}
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
*** Halbe Pixel?
|
||||||
|
#+begin_src processing
|
||||||
|
float x = 0;
|
||||||
|
|
||||||
|
void draw() {
|
||||||
|
background(255);
|
||||||
|
ellipse(x, 50, 30, 30);
|
||||||
|
x = x + 0.5;
|
||||||
|
}
|
||||||
|
#+end_src
|
||||||
|
*** Zeichenverkettung
|
||||||
|
#+begin_src processing
|
||||||
|
String message = "la";
|
||||||
|
String moreMessage;
|
||||||
|
|
||||||
|
void setup() {
|
||||||
|
println(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
void draw() {
|
||||||
|
moreMessage = message + moreMessage;
|
||||||
|
println(moreMessage);
|
||||||
|
}
|
||||||
|
#+end_src
|
||||||
** Syntax und Konventionen
|
** Syntax und Konventionen
|
||||||
#+begin_src processing
|
#+begin_src processing
|
||||||
final int speed=3;
|
final int speed=3;
|
||||||
@ -289,3 +324,16 @@ void draw() {
|
|||||||
moveballs();
|
moveballs();
|
||||||
}
|
}
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
** Arithmetische Operatoren
|
||||||
|
*** Muster
|
||||||
|
#+begin_src processing
|
||||||
|
int x = 0;
|
||||||
|
int y = 0;
|
||||||
|
|
||||||
|
void draw() {
|
||||||
|
line(x, 0, x, y);
|
||||||
|
x++;
|
||||||
|
y++;
|
||||||
|
}
|
||||||
|
#+end_src
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user