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);
}