We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi there! I've spent a long time trying to figure out how I can get my database and my mouse clicks to work. If someone could help me with it I would appreciate it so much. What I want to do is get the buttons on the side to individually have their own information from the database. When I use my mouse click command it goes on all three of the buttons but I want it to only work on one each. When you click on a button I wanted it to grab something from the database I've made so the first button would be the first bit in my database then where the database is spaced, that's for the second button. I'm quite confused on how to do this and my video is now not working as well (it's meant to tint to the jellyfish and it). If someone could help it would be great!
Answers
you can write your 3d botton shorter by the way:
The
\n
means new lineYou could also write:
Your Question
Check the mouse position against the burrons
eg.
next step I recommend a small variable that tells what entry of database to show:
(this must be before setup())
so if stateEntry would be 3 you show the info on "Relationships between jellies & other organisms" for example
so the above code would be
OK.
Now in draw evaluate stateEntry
Hope this helps.
Chrisir ;-)
Hey Chrisir, the buttons now work but on p5js int stateEntry is put like int(stateEntry = 0); IN the setup apparently according to it. I have no idea how to work around this because it still wont work http://alpha.editor.p5js.org/Jaz/sketches/rkNRPAuqb
Sorry you got it wrong
stateEntry : declare it before setup
In draw: separate strictly where you read mouse and where you evaluate entryState