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.
- Again, let's start with our main menu. Open up the
TicTacToeControl
script and go to theDrawOpening
function. - 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 books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.