Author Archives: maria c.

semesterarbeit cc1

1
Filed under uncategorized

Hey Jungs, es zeigt uns nicht das gewünschte Bild an. Was haben wir falsch gemacht?
danke und einen schönen sonntag noch

String textToDraw = “And through it all she offers me protection a lot of love and affection whether I‘m right or wrong and down the waterfall wherever it may take me I know that life won‘t break me when I come to call she won‘t forsake me I‘m loving angels instead”;
PImage bild;
PFont schrift;

void setup(){

size(1273, 900);

bild = loadImage(“flügel.jpg”);

schrift = loadFont(“Didot-Bold-20.vlw”);

textFont(schrift, 20);

noLoop();

}

void draw(){
background(255);

for (int y = 0; y < bild.height; y += textAscent()) {
for (int x = 0; x < bild.width; x++) {

// get the color at the current pixel
color c = bild.get(x, y);
// if the color is something else than a pure white
if (red(c) != 255 && green(c) != 255 && blue(c) != 255) {
// draw something at this position
fill(c);
text(textToDraw, x, y);
x += textWidth(textToDraw);
}
}
}

}

Antwort:

Hey, versucht mal diesen Code. An der Stele x += textWidth(textToDraw) wird immer die breite des kompletten Textes genommen. Das ist natürlich zu lang und breit. Versucht einmal, Textteile aus dem Text zu nehmen.

String textToDraw = “And through it all she offers me protection a lot of love and affection whether I‘m right or wrong and down the waterfall wherever it may take me I know that life won‘t break me when I come to call she won‘t forsake me I‘m loving angels instead”;
PImage bild;
PFont schrift;

void setup(){

size(1273, 900);

bild = loadImage(“flügel11.jpg”);

schrift = loadFont(“Serif-48.vlw”);

textFont(schrift, 20);

noLoop();

}

void draw(){
background(255);
// image(bild,0,0);
for (int y = 0; y < bild.height; y += textAscent()) {
for (int x = 0; x < bild.width; x++) {

// get the color at the current pixel
color c = bild.get(x, y);
// if the color is something else than a pure white
if (red(c) != 255 && green(c) != 255 && blue(c) != 255) {
// draw something at this position
fill(0);
text(“test”, x, y);
}
x += textWidth(“test”);
}
}

}

1
Filed under cc1

 

// x und y sind definiert
int x = 100;
int y = 100;
boolean rechts = true; // gehe nach rechts 
boolean links = false; // gehe nach unten
void setup() {
  size(200, 500);
  background(255); 
  smooth();
  fill(0);
  noStroke();
  void draw() {
    background(255);
    ellipse(x, y, 20, 20);
    if(x > = width – 10) {
      rechts = false; 
    }
    else if (x > = height – 10) {
      unten = false;
    }
    else if (y < = 10) {
      unten = true;
    }
    if (rechts == true) {
      x = x – 1;
    }
    if (unten == true) {
      y = y + 1;
    }
    else {
      y = y – 1;
    } 
  }
bei mir steht  unexpected token  : void 
was mach ich denn falsch ???

For – Schleife

0
Filed under cc1

Hinweis: bitte schaut für solche fragen ins wiki. dafür ist es da! wenn ihr konkret bei einem eurer projekte nicht weiter kommt, dann könnt ihr sie hier stellen.

Frage:
kann mir nochmal jemand sagen wie die for-schleife funktioniert?????

Antwort von Basar war:

for( int i=0; i < 10; i++) {
  //hier steht was wiederholt werden soll
}

int i -> initialisiert die variable vom typ integer, also ganz-zahl und in ihr wird der wert 0 gespeichert
i < 10 -> schleife läuft solange i kleiner als 10 ist
i++ -> i wird nach jedem durchlauf um 1 erhöht

Danke!

1
Filed under cc1

wisst ihr wie man sich von zu hause aus mit dem server in der schule verbinden kann

und auf seine ordner  zugreifen   kann   ??????

cc1

3
Filed under uncategorized

hey jungs …  ich mach grad die Aufgaben und komme mit AO3 nicht weiter!!!!!!!!!

ich weiß nicht so recht was da verlangt ist, kann mir vllt jemand helfen pls :S 

lg