Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: dakso on January 02, 2017, 02:06:25 AM

Title: UIViewport right side a space
Post by: dakso on January 02, 2017, 02:06:25 AM
(http://www.tasharen.com/forum/C:\Users\정재용\Desktop\viewport1.png)Currently using UIViewport.


In addition to the main UICamera, I'm using another camera for screen shots.


The size of the image used is larger than the size of the main camera.


So I'm using UIViewport to resize it, but there's a space on the right side of the camera.
Title: Re: UIViewport right side a space
Post by: dakso on January 02, 2017, 02:11:29 AM
Current state image of UIViewport. https://drive.google.com/open?id=0B3PWSzzHinTHVGtJekxRMFREcDg (https://drive.google.com/open?id=0B3PWSzzHinTHVGtJekxRMFREcDg), https://drive.google.com/open?id=0B3PWSzzHinTHUzJnMUY5VUVjSUE ,https://drive.google.com/open?id=0B3PWSzzHinTHZ2ZaamVNcTc1T0k (https://drive.google.com/open?id=0B3PWSzzHinTHZ2ZaamVNcTc1T0k)
Title: Re: UIViewport right side a space
Post by: ArenMook on January 04, 2017, 09:53:24 AM
UIViewport is a helper script that can set the camera's viewport rect. I am not sure what it is you're trying to do with it, but if you want one camera to match another, they both have to have identical viewports. Furthermore, setting the viewport doesn't change the camera. If your screen is 1280x720, but viewport rect is 1200x720, then you will have 80 pixels of padding somewhere on the sides.

Viewport just alters the drawing area. Technically this isn't an NGUI question at all -- I recommend checking Unity's documentation for the camera class.