We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hey guys!
I'm relatively new to Processing and I am experiencing a bit of trouble getting a series of ellipses created from tabular data to rollover when a mouse hovers. I'm sure this is a relatively simple fix, I just can't seem to work it out and am unable to find a helpful tutorial online so any help would be much appreciated!
Thanks in advance, Ryan
[image of source code deleted - see below]
Answers
In this forum please do not use an image to show your code since users can't test it. Simply paste the code then highlight it and press Ctrl+K, it will then be properly formatted for the forum. See here.
Change the fill color and draw the ellipse inside both parts of the final if statement.
OK sorry about that quark, here you go
Try deleting line 26 and replacing lines 39-43 with
I can't test this because I don't have the input file but I think it will work.
The draw method is called ~60 fps and the display is updated at the end of the draw method not after each ellipse(...) statement.
PS Before copying code from the PDE press Ctrl+T and it will correctly indent your code - try it and see the difference. :)
A slightly faster alternative w/o dist(): $-)
Hey guys
thanks so much for all your suggestions, unfortunately the Boolean and if statements above don't seem to work as the circles remain red, implying that the mouse is always being detect as being over the circles :-? I can't seem to figure this one out...
I have uploaded the .tsv file to this dropbox link here if you guys would like to have a go with it.
Cheers! Ryan
Well, I did a complete code refactoring. And placed the age x degree data into a List of PVector objects: (*)