Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: S3dition on October 09, 2013, 01:50:13 AM

Title: UI on game object (control panel, monitor)
Post by: S3dition on October 09, 2013, 01:50:13 AM
I've been searching for quite some time on information about applying the UI to a surface instead of binding it to a camera. Does anyone know where there is info about this? Is there a specific name I should be calling it when I do my searches? I need the ability to at least make it appear as if the GUI is on an object.

Thanks.
Title: Re: UI on game object (control panel, monitor)
Post by: ArenMook on October 09, 2013, 08:30:25 AM
Apply UI to a surface? If you have your UI camera render into a texture, you can then draw this texture somewhere in your world by texturing an object.
Title: Re: UI on game object (control panel, monitor)
Post by: Sylker on October 10, 2013, 10:58:25 PM
I tried to apply the render to texture over a plane and everything worked fine but the button's collider appears to be relative to the main camera instead. I can click and or mouse over it in a position that is different from the button's real location in screen.
Title: Re: UI on game object (control panel, monitor)
Post by: ArenMook on October 11, 2013, 07:53:23 AM
You won't be able to interact with a rendered texture. The UI created in this manner is for viewing only, not for interaction.

If you want it to be interactable, then you can make a 3D UI and place it anywhere you like in the world. Or just create a game object, put UIPanel, on it, then add child widgets underneath. Position it like you would any other object.
Title: Re: UI on game object (control panel, monitor)
Post by: Sylker on October 12, 2013, 11:43:09 PM
UI Panel over the plane was my first attempt and it worked fine.
I also got it to work using my own Raycast and RaycastHit.textureCoord (http://docs.unity3d.com/Documentation/ScriptReference/RaycastHit-textureCoord.html).
I just want to avoid use Raycast other than NGUI's nor change UICamera's original code.

I think we may have a feature request here , huh?