Hi, I am trying to automate a list of names so that they appear to me one by one when I move my mouse. At first I did it with an array of images with the names inside and it worked. Now I am trying to convert it to a Json file to make it more convenient and automatic. I already managed to load the Json file but I don’t know how to ask it to show me the list one by one. Thank you!!
Why don’t you use the code that you used when you had the images for your JSON?
When you get the json object containing the id and the name at index j like this : values.getJSONObject(j), you do the same but with the index that you increment when the mouse is moved. Then get the name.
Use the same technique for incrementing an index corresponding to the current name when the mouse is moved.
Note that you can also use the mouseMoved() function to detect when the mouse is moved rather than checking mouseX and pmouseX.
The code sample that you posted should give you an error in the Processing IDE (in red btw). Also remember that you can auto format your code by pressing Ctrl+T to correct indentations and spaces.
It should help you to see where the error is. You put a semicolon inside the if but you can’t actually. You want to do an AND?
The reference was a video but i needed to change it a little bit and this was the result, i was using if because i use it before, without the json, so i thought it would be a similar case.
which part is not correct? im sorry im learning and im very new with all of this.