Game Development Reference
In-Depth Information
Figure 11-2. The Camera's Far Clipping Plane adjusted
To fit the camera's view on screen in a less obtrusive manner, you will be adjusting its Viewport Rect.
The location and size values are all given as a percent of screen, where 1 is 100% of the screen.
Let's locate the spy view in the lower right of the screen.
3.
Set the W to 0.28 and the H to 0.5 .
4.
Set the X position to 0.7 and the Y to 0.03 .
5.
Turn off the GUILayer component.
The Main Camera's Depth is -1, but the Camera GUI's depth is the default 0. To keep the 2D zombie
bunnies from bouncing across it, you can set the Camera Spy View's Depth to a higher number so it
will be drawn last.
6.
Set the Camera Spy View's Depth to 1 .
7.
Disable the GardenLevel1's HideAtStart component.
8.
Click Play, and test.
9.
Exit Play mode.
If you were to allow the player to change the aspect ratio of the game window, you would have
to calculate the W value when the window changed. In this case, because you have specified the
aspect ratio, you will not have to script any adjustments.
 
Search WWH ::




Custom Search