O'Reilly logo

Unity 3.x Game Development Essentials by Will Goldstone

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating the menu with GUITextures and mouse events

In this first approach, we'll create a menu that uses a texture with a transparent background presented as a GUITexture, in the same way as we have just done with our main title logo.

We will then need to write a script in order to make the texture receive mouse events for mouse enter, mouse exit, and mouse down/up actions.

Adding the play button

In the Book Assets | Textures folder in the Project panel, select the texture called menu_playBtn. Go to GameObject | Create Other | GUITexture or select GUITexture from the Hierarchy Create button menu as before. Select the menu_playBtn object in the Hierarchy that you have just made and in the Inspector, set its Transform Position values to (0.3, 0.55 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required