Hello!
I am trying to create drawing letter, witch consist of ellipse. Every next letter type after key pressed. I can’t change fist position every next letter to create new letter after previous letter and gap space.
ell [][] newell;
int cols = 40;
int rows = 40;
float dist;
int x2;
int y2;
void setup()
{
size(1000,1000);
background(255);
newell = new ell [cols][rows];
ellipseMode(CORNER);
dist = min(width/cols, height/rows);
for (int i = 0; i < cols; i++)
{
for (int j = 0; j < rows; j++)
{
if (i%2==0)
{
newell [i][j] = new ell (i*dist, j*dist, dist-3);
} else
{
newell [i][j] = new ell (i*dist, j*dist + 10, dist-3);
}
}
}
}
void draw ()
{
drawdot();
posXY();
}
void drawdot()
{
for (int i = 0; i < cols; i++)
{
for (int j = 0; j < rows; j++)
{
newell [i][j].update();
}
}
}
void posXY()
{
for (int x1 = 2; x1 < 30; x1++) //x1 = 2; y1 = 2; fist dot
{
for (int y1 = 2; y1 < rows; y1++)
{
x2 = x1 + 4;
y2 = y1;
}
}
//drawA(x2, y2); not work
drawA(2, 2);
}
void drawA(int x, int y)
{
if (keyPressed)
{
if (key == 'a')
{
newell [x][y+1].c1 = 255;
newell [x+1][y].c1 = 255;
newell [x+2][y+1].c1 = 255;
newell [x+2][y+2].c1 = 255;
newell [x+2][y+3].c1 = 255;
newell [x+0][y+3].c1 = 255;
newell [x+1][y+2].c1 = 255;
newell [x+1][y+3].c1 = 255;
}
}
}
class ell
{
color c1;
float x;
float y;
float s;
ell (float tempx, float tempy, float temps)
{
x=tempx;
y=tempy;
s=temps;
c1 = #C0CBD1;
}
void update()
{
fill (c1);
stroke(#C0CBD1);
ellipse (x, y, s, s);
}
}
Thank you for every advice!
And sorry for my bad English. I hope I could explain what I plan to do and what my problem