Book Image

OUYA Game Development by Example

By : John Donovan
Book Image

OUYA Game Development by Example

By: John Donovan

Overview of this book

The OUYA console and development kit gives you the power to publish video games for the players, creating a console marketplace of the gamers, for the gamers, and by the gamers. Using the OUYA developer kit and the Unity3D game engine, even beginners with a captivating game idea can bring it to life with a hint of imagination. OUYA Game Development by Example uses a series of feature-based, step-by-step tutorials that teach beginners how to integrate essential elements into a game engine and then combine them to form a polished gaming experience.
Table of Contents (18 chapters)
OUYA Game Development by Example Beginner's Guide
About the Author
About the Reviewers

Time for action – setting up a GUI Text object

The Unity engine features a component/object type named GUIText, which can display raw text and numerical values as stylized text on your game's viewport. We can write a script for a new GUIText component that will determine the total number of coins collected and update the displayed text with that count. Perform the following steps to set up GUIText:

  1. Make a new GUIText object from the Create menu of your Hierarchy window.

    You'll notice that the GUIText position is set to 0.5, 0.5, 0 by default. However, it displays in the middle of the game window regardless of your position. That's because a GUIText position value doesn't affect its global position, only its location on the screen.

    We want GUIText to appear in the upper-right corner so that it doesn't obscure the center of our view, so we'll change the coordinates to the maximum X and Y values. The Z value of GUIText represents the depth, which won't become apparent until you have multiple texts...