Author Topic: NGUI & Vuforia - Takescreenshot without GUI showing  (Read 11747 times)

retox

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
    • View Profile
NGUI & Vuforia - Takescreenshot without GUI showing
« 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

Cripple

  • TNP Alpha
  • Full Member
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 117
    • View Profile
Re: NGUI & Vuforia - Takescreenshot without GUI showing
« Reply #1 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.
Graphicstream Dev.

retox

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
    • View Profile
Re: NGUI & Vuforia - Takescreenshot without GUI showing
« Reply #2 on: September 02, 2013, 05:43:04 AM »
Lo Cripple,

Thanks for the tip. Will give it a go.  :)

retox

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
    • View Profile
Re: NGUI & Vuforia - Takescreenshot without GUI showing
« Reply #3 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.

Slyfox

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 12
    • View Profile
Re: NGUI & Vuforia - Takescreenshot without GUI showing
« Reply #4 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?

LightSky

  • Jr. Member
  • **
  • Thank You
  • -Given: 3
  • -Receive: 2
  • Posts: 56
    • View Profile
Re: NGUI & Vuforia - Takescreenshot without GUI showing
« Reply #5 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.

retox

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
    • View Profile
Re: NGUI & Vuforia - Takescreenshot without GUI showing
« Reply #6 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 :)

D3m0n92

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1
    • View Profile
Re: NGUI & Vuforia - Takescreenshot without GUI showing
« Reply #7 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 :(