Transforming object to a letter (text)

Hello everyone!
I’ve got a question. I am absolute newbie in processing and I want to create some interactive typographic thing.
Can you help me?
I need to transform an ellipse to a letter (text). Let’s say “A”. It should move around the sketch - i’ve already got this code.
I would be greatful for your answer and help! Thank you!

Here’s the code

float x, y;
float easing = 0.1;
boolean go=false;
PFont F;

void setup() {
size(1920,1080);
rectMode(CENTER);
newPosition();
F=createFont(“Arial”,200,true);
}

void draw() {
background(128);
PVector p = new PVector( mouseX-x, mouseY-y, 0);
p.limit(2);
if (go && dist(mouseX, mouseY, x, y)<400) {
x-=p.x;
y-=p.y;
}
x = constrain(x,25,width-25);
y = constrain(y,25,height-25);
textFont(F);
ellipse(x, y, 50, 50);
if (mouseX>x-25 && mouseX<x+25 && mouseY>y-25 && mouseY<y+25) {
newPosition();
}

fill(0);
//textFont(F);
translate(120,240);
text (“H”,0,0);
translate(210,70);
text (“E”,0,0);
translate(220,10);
text (“L”,0,0);
translate(230,20);
text (“L”,0,0);
translate(240,30);
text (“O”,0,0);

}

void mouseMoved() {
go=true;
}

void newPosition() {
x=random(width);
y=random(height);
}

1 Like

you mean that the ellipses evolves into A and that this happens in an animation?

Like a morphing effect?

No. I mean transforming like exchaning the object (ellipse) to a letter. I want basicly this ( https://dia.tv/project/klim-sohne/#slide-4 ) for example - i have a code for moving the object, but I want the object to be a letter and the letter should move around the sketch :slight_smile: . If you understand me (sorry for bad english).

1 Like

replace this by

text ( "A", 
      x, y );

maybe set textSize() before this?

1 Like

Great! That works! Thank you :slight_smile:

1 Like

Great!

And welcome to the forum!

Great to have you here.

Warmest regards,

Chrisir

2 Likes