Book Image

Creating E-Learning Games with Unity

By : David Horachek
Book Image

Creating E-Learning Games with Unity

By: David Horachek

Overview of this book

Table of Contents (17 chapters)
Creating E-Learning Games with Unity
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Exploring the GUITexture component


As we can now display 2D text, let's discuss how we can add visually appealing graphics to our interfaces; the GUITexture component does precisely this. You can see the GUITexture component as follows:

The Texture field is a reference to a 2D graphic element. This could be a .png, .jpg, or .bmp file that you created in the Paint program on your computer. Each file type has its benefits and drawbacks depending on how much compression you need in your file. Dragging-and-dropping it into the Project tab will import the image, after which you can set the reference.

The Color field lets the user select a specific tint for the GUITexture. This is a convenient way to fine-tune the appearance of the texture without having to edit it in your external Paint program.

The Pixel Inset field works in a way similar to the Pixel Offset field. The X and Y fields correspond to the screen space coordinates of the upper-left corner of the texture. The Width and Height fields...