Creating ellipses with text in it


#1

T-oben

I would like to create a Ellipse with text in it, at a specificed Position.
Is that possible?


#2

Yes.

float x, y;
String s = "Text!";

  void setup() {
  size(600, 400);
  x = 200;
  y = 200;
  textAlign(CENTER);
  textSize(20);
}

void draw() {
  background(0);

  pushMatrix();
  fill(255);
  noStroke();
  translate(x, y);
  ellipse(0, 0, 100, 100);
  fill(0, 100, 0);
  text(s, 0, 6);
  popMatrix();
  
}

#3

Thank you, you helped me a lot