Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Mcckl on December 12, 2013, 11:52:42 AM

Title: NGUI on custom Mesh
Post by: Mcckl on December 12, 2013, 11:52:42 AM
Hi!
Is it possible to display the NGUI Menu on a non-planar Mesh, like a text wrapping around a cylinder or sphere?

Cheers,
Mike
Title: Re: NGUI on custom Mesh
Post by: Ferazel on December 12, 2013, 12:08:05 PM
The only way I can think of how to do this now, is to render the UICamera to a texture and then use that texture to be applied to a cylinder.
Title: Re: NGUI on custom Mesh
Post by: Mcckl on December 12, 2013, 12:13:33 PM
Thanks,
but that sounds as bad as the standard Unity GUI....
Title: Re: NGUI on custom Mesh
Post by: ArenMook on December 12, 2013, 02:31:08 PM
Well yes, just as bad. You're desiring highly custom functionality here. All UI is drawn using quads, and quads, by nature, don't bend.
Title: Re: NGUI on custom Mesh
Post by: Nicki on December 12, 2013, 07:24:34 PM
UICam to RenderTexture, apply rendertexture to mesh.

Working with rendertexture is a bit different than just regular cameras, so be careful you don't get weirdness with alphas; I've had that in the past.
Title: Re: NGUI on custom Mesh
Post by: Mcckl on December 17, 2013, 12:06:19 PM
Thanks for your help,
updating the RenderTexture is quite expensive. But when the UI is turned off, the RenderTexture keeps the last image, with great performance.

Of course using the RenderTexture doesn't work with Buttons. Is there a possibility to relay rayCasts on the Object displaying the RenderTexture to the underlying UI?