Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: retox on September 01, 2013, 01:24:28 PM

Title: NGUI & Vuforia - Takescreenshot without GUI showing
Post by: retox on September 01, 2013, 01:24:28 PM
Hi Guys,

I'm working on a small project that combines Vuforia & NGUI plugins for an Android & iOS app. It requires a function for taking and storing screenshots into SD Card/cameraroll respectively. So far so good and every thing is working.

However, the app is taking screenshots with the GUI showing, which looks a bit lame. Is there some way to disable the GUI whilst the screenshot action is selected.

Keen to crack on with GUI design, but want to get this out the way first.

Many thanks in advance.

S
Title: Re: NGUI & Vuforia - Takescreenshot without GUI showing
Post by: Cripple on September 01, 2013, 03:22:08 PM
Use a camera to render to a texture, and set the camera to not draw the NGUI layer.
Title: Re: NGUI & Vuforia - Takescreenshot without GUI showing
Post by: retox on September 02, 2013, 05:43:04 AM
Lo Cripple,

Thanks for the tip. Will give it a go.  :)
Title: Re: NGUI & Vuforia - Takescreenshot without GUI showing
Post by: retox on September 02, 2013, 08:38:13 AM
Having a few early issues. I've followed the process of rendertotexture via http://docs.unity3d.com/Documentation/Components/class-RenderTexture.html but either the AR vanishes or the GUI does. I've changed the culling and still not figured it out.

I have 2 cameras in the scene by default of Vuforia and NGUI, do I need to add another camera and set this one up with draw textures?

I've been going around in circles so much I think I'm messing up something that should be relatively simple to achieve.
Title: Re: NGUI & Vuforia - Takescreenshot without GUI showing
Post by: Slyfox on September 02, 2013, 11:59:23 AM
Can't you just use the camera.SetActive(false); method on your 2D camera before the screenshot is taken?
Title: Re: NGUI & Vuforia - Takescreenshot without GUI showing
Post by: LightSky on September 02, 2013, 04:57:16 PM
Just have the NGUI Camera's Culling Mask to Nothing.

Example:

public Camera cam;  //Set this to your NGUI Camera
int PrevMask = cam.cullingMask;
cam.cullingMask = 0;
Take picture with your Plugin/Program
cam.cullingMask = PrevMask;

What this does is sets your UI Camera Culling Mask to 0, which is Nothing.  So this way it will stop rendering all of the NGUI UI so you can take your picture.
After the picture is taken it sets the Culling Mask back to it's previous value.
Title: Re: NGUI & Vuforia - Takescreenshot without GUI showing
Post by: retox on September 07, 2013, 05:35:46 PM
Thanks guys. We are on the right path now.

Unless anyone has any thoughts on video capture. But this should be discussed in another topic me thinks :)
Title: Re: NGUI & Vuforia - Takescreenshot without GUI showing
Post by: D3m0n92 on February 26, 2017, 01:21:17 PM
Hi Guys,

I'm working on a small project that combines Vuforia & NGUI plugins for an Android & iOS app. It requires a function for taking and storing screenshots into SD Card/cameraroll respectively. So far so good and every thing is working.

However, the app is taking screenshots with the GUI showing, which looks a bit lame. Is there some way to disable the GUI whilst the screenshot action is selected.

Keen to crack on with GUI design, but want to get this out the way first.

Many thanks in advance.

S

You can help me with script for take screenshot whit Vuforia?  can not get it to work :(