Time for action – making an automatically scaling GUI texture
The logo of our marble game may fill the screen in the Game window, but it may not be big enough to cover the entire view area when it's running on fullscreen on OUYA. Fortunately, there's an easy trick you can apply to make your fullscreen textures automatically scale to the size of your screen, and it doesn't even require any code:
In order to have an autoscaling texture, you need to remove all the Pixel Inset values from the Inspector window of the logo's GUITexture. Set the X, Y, W, and H values of Pixel Inset to
0
.Your logo should now have no nonzero values besides the centered X and Y position values (at 0.5 each) and the Z scale (at 1). This is shown in the following screenshot:
With these settings, your logo will disappear from your Game window, but we can make it show up again by editing the X and Y scale values.
Change the X and Y scale values to
1
.
Your logo should now perfectly fill the Game window, no matter how you size...