Programm im Editor öffnen

 

Quellcode ohne Kommentar

function setup() {
  createCanvas(300, 300);
}

function draw() {
  background(171, 130, 255);
  fill(0);
  textAlign(CENTER);
  textSize(30);

  if (mouseX < width / 2) {
    text("Links", mouseX, mouseY);
  } else {
    text("Rechts", mouseX, mouseY);
  }
}

Quellcode mit Kommentar

function setup() {
  createCanvas(300, 300);
}

function draw() {
  background(171, 130, 255);
  fill(0);
  textAlign(CENTER);
  textSize(30);
  
  if (mouseX < width / 2) {
    text("Links", mouseX, mouseY);
  } else {
    text("Rechts", mouseX, mouseY);
  }
}
Zuletzt geändert: Dienstag, 20. Mai 2025, 06:04