Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Fractalbase on June 24, 2014, 06:22:31 PM

Title: Center Drawn Game Graphics to a Rectangle in the Game Window
Post by: Fractalbase on June 24, 2014, 06:22:31 PM
Is it possible to center the game graphics rendered to a particular rectangle in the game window?  For example, in the interior of a sprite?  And then what would be the method to clip game artwork outside of that rectangle (or depending on how the graphics is rendered, I might assume that I have to calculate clipping myself)?  Is there a better way to zoom in and out of the graphics (for a 2D game) then adjusting the z position coordinate of the main camera?

thanks,
fb
Title: Re: Center Drawn Game Graphics to a Rectangle in the Game Window
Post by: ArenMook on June 25, 2014, 07:20:02 AM
I don't quite understand what you mean. Center game graphics?
Title: Re: Center Drawn Game Graphics to a Rectangle in the Game Window
Post by: Fractalbase on June 25, 2014, 07:44:35 AM
Typically, the main camera is positioned at (0, 0, z).  This draws graphics on the entire screen centered at the center of the screen.  I will like to render game graphics only in a subset of the screen, a rectangle.  Then I want the center of that rectangle to be aligned with the center of the camera.  Is there a simple way to accomplish that?
Title: Re: Center Drawn Game Graphics to a Rectangle in the Game Window
Post by: ArenMook on June 25, 2014, 07:57:23 AM
This is controlled by specifying a view rect on the Camera. It's Unity's functionality and has nothing to do with NGUI.