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
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Time for action – hiding the cursor on the screen


OUYA's cursor is slightly different than other components of our game in that it's displayed and managed by an unseen Java script that we didn't need to create. This code is a core part of the OUYA SDK, so we can't change it directly; instead, we need to use methods that have been included in the SDK that serve the purpose of safely modifying core functionality.

By default, the cursor appears whenever the cursor is moved, as shown in the following screenshot:

Perform the following steps to hide the cursor on the screen:

  1. Create a new function called HideCursor in CursorScript.cs:

    void HideCursor()
    {
    
    }
  2. Add the following line to the HideCursor function to call the Java function that hides the cursor graphic:

    void HideCursor()
    {
      OuyaSDK.OuyaJava.JavaShowCursor(false);
    }
  3. Add a call to HideCursor in your Update function so that it's called for every frame:

    void Update()
    {
      HideCursor();
    }
  4. Deploy your game to the OUYA console and swipe the touchpad to...