Well, since you want to go with a simple array instead of Lists (arrays have fixed size), itās going to be a bit easier.
Also, itās generally confusing when you start programming, just like itās confusing to have to write in a language you donāt know⦠itās obviously going to take a while, but itās a lot simpler than learning a new language, since most of the things are already translated to english, so you can what things do or how to do things.
What you need to keep in mind, is that programming is basically just 2 things. Knowing what you want and knowing how to split it up into smaller parts (individual commands). Well, thereās also other stuff like knowing what is more efficient, how to do certain things, a bit of Math is also useful, knowing where to look for answers (documentation/references, github and so on) and other things, but they come naturally over time and thereās no need to know everything at once.
As for your Code, what you want is to display Text in a drawn path. So what we need for that, is :
ā¢a way to display text in specific positions
For this we need :
ā¢the specific positions
ā¢the character to display in these positions
ā¢An array of characters or a String. Weāll just use āHelloā for now.
ā¢The index at which the char is that we want to display at the position of the path array with the same index
ā¢a way to get/set those locations
For that we need :
ā¢mouse position while the mouse is pressed
ā¢an if statement, to check if the mouse is pressed
ā¢the last index we set in the path array, to set the position to the next index
ā¢an array to store the position
ā¢we need to know the length of the text
So these will be the lines of Code we need (not in that order/ not used in this way) :
//our text
String text = "Hello";
//the index we last saved a position to
int index;
//iād rather use PVector[] for this, but letās go with this for starters
//The positions of our path
float[] pathX = new float[text.length()];
float[] pathY = new float[text.length()];
//a way to display the char at the position (both having the same index)
text(char c, float x, float y);
//a way to check if we want to add a new position
if (mousePressed) {}
//a way to check if we still want to add positions
if (index < text.length()-1) {}
//the actual positions for the points of our path
mouseX;
mouseY;
//Note that the length of an array is read with .length, while the length of a String is read using .length().
//a way to iterate over each position in the array/each char in the text we already have a position for
for (int i = 0; i < index; i++) {}
//a way to space out the characters a bit
dist();//to measure the distance to the last position we have, to space the chars out a bit
//a way to get a char at an index of a String
text.charAt(i);
I hope i didnāt forget anything there⦠
That should be all you need to do it. If you need help with anything, just tell me 