- Home /
How interact on a GUI Texture in a scen with 2 cameras.
Hi Guys,
Here is my problem :
I've a scen with 2 Camera. So my screen is split. Everything is good.
I've a GUI Texture only visible on Camera 1. It is good.
My probleme is that I can't interact on my GUI Texture. I'd like to open an external Link but it doesn't work.
I 've the code that works great for the external link, but it works only when my scene has one camera.
Come one can help me ?
Many thanks.
$$anonymous$$aybe the position and the scale of the GUITexture according to your screen is changed. I don't know. Try to add some relevant code, then we could help you further.
Answer by Befall · May 16, 2012 at 08:52 PM
Try creating your own HitTest() script, which grabs any applicable GUITextures from the scene and returns any of them that you clicked.
You can do this by grabbing the mouse position on screen upon clicking, and using the pixelInset and transform info of the GUITexture, figure out if the mouse click is within the bounds of the GUITexture and that the GUITexture has the highest Z value (for stacked GUITextures), and return it.
Then, you can have code that's like
if (HitTest() == linkGUI)
openLink();
etc etc.
Does this help?
Your answer
Follow this Question
Related Questions
Way to have a pause and play texture in same GUI texture? 0 Answers
Resizable GUI textures 1 Answer
How do I get a GUI Texture Button to act as a Input Key such as a T button on a key bored or so? 1 Answer
GUI looks Awful! 0 Answers
Change Gui Textre to another overtime? and reset script when player passes through trigger 1 Answer