We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I am trying to display "id" in the centre of object.
Niche(int id, PVector loc, boolean settled) {
ref = id;
happy = settled;
//create Nucleus
centre = new Nucleus(id, false, loc);
//create boundaryNodes
for (int i=0; i<numNodes; i++) {
origin = loc.get();
nodes[i] = new boundaryNode(id, true, false, origin);
Thanks in Advance.
Answers
add up all the x and y coordinates, divide by the count to give you the centre of the shape.
post a runnable example.
i have center location nucleus.add(space[i].nodes[i].pos); but i want to display number or string inside it.
for
ellipse()
you can change the meaning of the parameters withellipseMode
for
text()
you can change it with textAlign. e.gtextAlign(CENTER,CENTER);
ortextAlign(LEFT);
so