O'Reilly logo

Unity Android Game Development by Example Beginner's Guide by Thomas Finnegan

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

Time for action – the dynamic GUI

We will be covering two excellent ways of dynamically adjusting our GUI to meet any screen requirements. The opening screen and the game over screen will both be centered. We will stretch the game board to fill the available space. The turn indicator text will also be set up to automatically change position based on the screen orientation.

  1. Again, let's start with our main menu. Open up the TicTacToeControl script and go to the DrawOpening function.
  2. To center the menu, we will wrap up the contents as a GUI group by adding the following line of code at the beginning of the DrawOpening function. Think of GUI's grouping as picture-in-picture (PIP) that some televisions can do. Pick a rectangle section on screen and ...

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