Processing Java: Align text and ellipse -
i trying align string of text , ellipse vertically in processing. although both textalign
, ellipsemode
set center
, there still slight offset between text , ellipse.
void setup() { size(200, 200); background(255); textalign(center); ellipsemode(center); nostroke(); smooth(); fill(0); text("document 1.txt", 60, 20); fill(255, 0, 0); ellipse(120, 20, 10, 10); }
instead of textalign(center)
, specifies horizontal alignment, used textalign(center, center)
, guarantees text aligned both horizontally, , vertically.
Comments
Post a Comment