- Home /
Mouse click on a box
Hi,
I have some issues with mouse clicking (& mouse over) on boxes in the GUI.
I have 2 windows, and in one of them I create up to 10 boxes with texture loaded from the web. Then I want to alow click on this boxes, and based on the clicked image display it biggeer in the other window.
Now, for collision, I've seen the possibility with rect.collision. The problem is that I use a GUILayout, so I create the boxes as:
GUILayout.Box(((ImageThumbScript)thumbs[i]).GetImage(), GUILayout.Width(100), GUILayout.Height(100));
The issue is that by using GUILayout, I can't create a layout conform rectangle ...or at least this is what I understood.
How can I perform collision and still use the layouting?
Ah.. and I don't want to use buttons instead of boxes...the image looks funny.
Thanks!
Your answer
Follow this Question
Related Questions
Only updating once during left mouse button being held down. 3 Answers
How to make object clickable when user enter collider ? 0 Answers
How do you check if the object that you want to destroy with a click is the right object? 1 Answer
My inventory opens and closes on left mouse click when i don't want it to. 1 Answer
GUI texture to change texture when hovered over or clicked? 2 Answers