Hi Guys I want to make an animated gif with letters but I want the letters to change forms with no mouse Pressed can I do it? And it’s possible to save this gif into png? Thaaanks
import controlP5.*;
boolean record;
ControlP5 cp5;
Group g1;
//vars
int offset = 15;
int orbitRadius = 20;
int radius = 1;
int waveStrengthHorizontal= 5;
int waveStrengthVertical= 5;
float speed = 1;
PFont myFont;
void setupUI()
{
cp5 = new ControlP5(this);
int space = 15;
int cy = 0;
int bx = 5;
int by = 5;
g1 = cp5.addGroup("Parameter")
.setPosition(100,100)
.setWidth(250)
.setBackgroundHeight(100)
.setBackgroundColor(color(255,50));
cp5.addSlider("offset")
.setPosition(by, bx + space * cy++)
.setRange(0,30)
.setGroup(g1);
cp5.addSlider("orbitRadius")
.setPosition(by, bx + space * cy++)
.setRange(0,30)
.setGroup(g1);
cp5.addSlider("radius")
.setPosition(by, bx + space * cy++)
.setRange(0,30)
.setGroup(g1);
cp5.addSlider("waveStrengthHorizontal")
.setPosition(by, bx + space * cy++)
.setRange(0,30)
.setGroup(g1);
cp5.addSlider("waveStrengthVertical")
.setPosition(by, bx + space * cy++)
.setRange(0,30)
.setGroup(g1);
cp5.addSlider("speed")
.setPosition(by, bx + space * cy++)
.setRange(0,30)
.setGroup(g1);
g1.setPosition(10, height - 120 + 10);
}
void setup()
{
frameRate(50);
size(500, 500, P2D);
beginRecord(PDF,"everything.pdf");
setupUI();
background(0);
myFont = createFont("ATSackersHeavyGothic-48.ttf",34);
}
void draw()
{
background(0);
// text("3",10,10);
int vCount = height / offset;
int uCount = width / offset;
for(int v = 0; v < vCount; v++)
{
for(int u = 0; u < uCount; u++)
{
float ox = u * offset;
float oy = v * offset;
float strength = u * waveStrengthHorizontal + v * waveStrengthVertical;
int finalSpeed = (int)(360 / speed);
float angle = (float)((((frameCount + strength) % finalSpeed) * Math.PI) / 90);
float x = (float)(orbitRadius * Math.cos(angle));
float y = (float)(orbitRadius * Math.sin(angle));
stroke(255);
fill(255);
textSize(26);
text("3",x + ox, y + oy, width/2, height/2);
}
}
}
void keyPressed()
{
if(key == 'h')
{
g1.setVisible(!g1.isVisible());
if (key == 'q') {
endRecord();
exit();
}
}
if (record) {
endRecord();
record = false;
}
}
// Use a keypress so thousands of files aren't created
void mousePressed() {
record = true;
}