We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Dear All, I am trying to write some words with giving a certain space each other...
for example:
Love (100 pxl space) Hate (100 pxl space) Crazy (100 pxl space) Bomb
this is the code that does not work / or is wrong;
String buttons []= { "Love", "Hate", "Crazy", "Bomb"};
for (int i = 0; i < buttons.length; i ++) {
fill(204, 102, 0);
translate (................); // give 100 pxl space
text (buttons[i], 0, 0);
Note: is it also possible giving different distances?
Thank u Best
Answers
This is one way to do it.
You can of course give different translate values:
Dear sableRaph, Thank you so much, everything works great... best
You're welcome.
Remark: The space you give using translate() is not the distance between two words but the distance of one word from the left point of the previous word. For more control, you will want to use the textWidth() method (http://processing.org/reference/textWidth_.html).