Intro to Unity GUI

This post contains an solutions to my Unity programming exercises and classes I showed at the lectures. This post cover coding some basic things about using Unity GUI system.

StartScreenGUI (C#)

This class creates simple re-sizable and skinnable start screen for a game with main screen, credits screen, and confirm screen for quitting. The main screen is show in the Figure (with the textures and skin setup).

This class offers static function and const to set up GUI.matrix and getting the screen size for drawing. This class cannot be attached to any game object, but is accessed like GUI.matrix = GUIGlobals.GetGUIMatrix();. With setup presented below, the layout is done to screen size 1280×800.