A D-pad is simply four buttons on a directional pad. To create a D-pad for a mobile game, you just need to create a graphic that contains four buttons on the directions.
The art used in this example was obtained from https://opengameart.org/content/onscreen-controls-8-styles.
To create a virtual D-pad, complete the following steps:
- Create a new scene named Chapter10Example2 in the Assets/Scenes folder and open the new scene.
- Import the d-pad buttons.png sprite sheet into the Assets/Sprites folder.
- Change the newly imported sprite's Sprite Mode to Multiple and automatically slice it.
- Create a new Canvas with Create | UI | Canvas. Name the new Canvas D-Pad Canvas.
- The size of a D-pad is ...