Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Unity Game Development Blueprints
  • Toc
  • feedback
Unity Game Development Blueprints

Unity Game Development Blueprints

By : John P. Doran
4 (6)
close
Unity Game Development Blueprints

Unity Game Development Blueprints

4 (6)
By: John P. Doran

Overview of this book

If you want to build enticing projects with Unity, this book is for you. Readers who are familiar with the basics of how to create simple projects in Unity will have an easier time.
Table of Contents (11 chapters)
close
10
Index

Customizing the GUI


While it is great that Unity provides us with all of this functionality to save us time in creating elements, the actual aesthetics leaves a little to be desired. Thankfully, UnityGUI allows us to customize the appearance of our controls by making use of GUIStyle, which is an optional third parameter to our control functions. If we do not specify a GUIStyle parameter, Unity's default will be used, which is what we experienced last time. This can work fine while testing something out. However, since we're trying to create a polished and complete project, we're going to create one of our own by performing the following steps:

  1. Open up the MainMenuGUI script file and modify the function to accommodate the changes in bold:

    using UnityEngine;
    using System.Collections;
    
    public class MainMenuGUI : MonoBehaviour {
      public int buttonWidth = 100;
      public int buttonHeight = 30;
      public GUIStyle titleStyle;
      public GUIStyle buttonStyle;
    
      void OnGUI() 
      {
        //Get the center...
bookmark search playlist font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete