x


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.

more ▼

asked May 14 '12 at 03:15 PM

michael bricout gravatar image

michael bricout
3 1 1 1

Maybe 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.

May 14 '12 at 08:08 PM bompi88
(comments are locked)
10|3000 characters needed characters left

1 answer: sort newest

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?

more ▼

answered May 16 '12 at 08:52 PM

Befall gravatar image

Befall
121 11 12 14

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x3815
x23
x9

asked: May 14 '12 at 03:15 PM

Seen: 527 times

Last Updated: May 16 '12 at 08:52 PM