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 ...

Get Unity Android Game Development by Example Beginner's Guide now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.