Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: Tripwire on April 30, 2014, 03:12:36 AM
-
Hi,
I'm trying to create a PNG of a part of the NGUI UI which is customizable by the user. The object i'm trying to create a PNG of consists of the following objects:
UITexture
-Sprite
-Sprite
-label
I've tried using readpixels but I can't get the position right. I also tried using a render texture but that only gives me a black texture in the end. Is NGUI providing something like this to create a PNG from UI object? If not how would I achieve this?
-
You can do it by moving the things you want to capture into another UI. Then you can use a RenderTexture on the Camera and capture the pixels.
-
thx for the reply! Can you give an example? I have no idea how to do this actually.
-
Just the ordinary way render textures work in Unity. Set up a camera, create a render texture, assign the camera to render into this render texture. Everything drawn by this camera will be in the render texture that you can then draw using a UITexture. Check Unity's docs on how to create and use render textures.