I am working on a program that have to use mouse over or mouse click. I have different buildings(image) on the screen, and when the mouse over one of the blocks, an image(a face or a mouth) will apear in the block, and also appear the text in the array with the same block.
For example, when my mouse over the first block, an image will show in the blocks, and a line of the text array [0] (the fist block in the array) will appear.
So I need to get which block I am focus on (the index number of blocks) and show image in that block.
The problem is I don't know how to check the mouse over the block and get the index number of that block.
2. I have read this page( https://forum.processing.org/topic/mouse-over-getchild-in-pshape) , and use the library inside, but the problem is when I have to show the image, I have to make those image as path in AI, and one face are make by many paths, so when I have to getChild, I don't know how to get the exactly child. The problem is I am also an idiot in AI and drawing. Is there any easy way to make things as an svg?
3. The library I have seen is basically change the color of one part(the child), but if I want it to be visible or invisible, I cannot do it.
4. I know PShape can make shape become visible or invisible, but PShape have to know the exactly position of every shape(where they should put), so return to the first problem, I don't know the position......
Sorry it is a long question, but i hope someone can help me:(
Thank you for you time. Thanks a lot.
The problem is I don't know how to check the mouse over the block and get the index number of that block.
1. Because the buildings are actually image, and I cannot check the position(x, y) of every blocks, they are not align.
2. I have read this page( https://forum.processing.org/topic/mouse-over-getchild-in-pshape) , and use the library inside, but the problem is when I have to show the image, I have to make those image as path in AI, and one face are make by many paths, so when I have to getChild, I don't know how to get the exactly child. The problem is I am also an idiot in AI and drawing. Is there any easy way to make things as an svg?
3. The library I have seen is basically change the color of one part(the child), but if I want it to be visible or invisible, I cannot do it.
4. I know PShape can make shape become visible or invisible, but PShape have to know the exactly position of every shape(where they should put), so return to the first problem, I don't know the position......
Sorry it is a long question, but i hope someone can help me:(
Thank you for you time. Thanks a lot.
1