Hello. this is a small mini project. I am already so far that it is a normal interpretation of a text box with mouse tracking.
Now I try to modify the text if you move the red button around (textbox size).
By modify i mean something simple. like text size that changes dynamically. Text that overlaps or single letters that start to mirror each other. A small tool which serves more for entertainment…
Would be glad if someone explains me the mechanism. The text must be somehow merged with the mouse tracking.
PFont Nexa;
float mx;
float my;
float easing = 0.05;
int radius = 24;
int edge = 100;
int inner = edge + radius;void setup() {
size(900, 900);
//fullScreen(2);
noCursor();Nexa = createFont(“Nexa Bold.otf”, 111);
ellipseMode(RADIUS);
ellipseMode(RADIUS);
rectMode(22);
}String quote = “SILLY TEXT FRAME –TO CONTROL THE VERTICAL ALIGNMENT OF TYPE, THE DISTANCE TEXT IS INSET FROM THE EDGE OF THE FRAME.XOXO XOOXOXOX OXOXOX OOXOX OXOXO XOXOX OXOX OOXO XOXO XOXOO XXO”;
//\n//Nexa(textValue + getCursor(), x + 5, y + boxHeight/2);
void draw(){
background(#f1f1f1);
fill(0);
textFont(Nexa);
textSize(111);
//textAlign(frameCount, frameCount);//ADD TEXT TO STRING
float fontSize = 315;
float lineHeight = fontSize * 0.9;textAlign(RADIUS, TOP);
//
fill(0);
text(quote, 33, 33, mouseX, mouseY );
noFill();
stroke(#F03C3C);
strokeWeight(7);
rect(22, 22, mouseX, mouseY);
textAlign(LEFT, mouseY);
fill(#F03C3C);//frameCount
//Movment
if (abs(mouseX - mx) > 0.1) {
mx = mx + (mouseX - mx) * easing;
}
if (abs(mouseY - my) > 0.1) {
my = my + (mouseY- my) * easing;
}mx = constrain(mx, inner, width - inner);
my = constrain(my, inner, height - inner);
fill(76);
// rect(edge, edge, width-edge, height-edge);
fill(#F03C3C);
ellipse(mx, my, 11, 11);//ellipse(width-mouseX, frameCount, 66, 66);
// ellipse(mouseX, mouseY, 11, 11);
//text(“here”, width-mouseX, mouseY);//rect(30, 20, 55, ); //space left
}