Creating menus for keyboard or gamepad input



Attached Files

The following files have been attached to this tutorial:



Download now 125.82 KB


4,792 visits, 11,686 views


This tutorial hasn't been translated.



This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

In most games, you’ll probably find yourself needing to implement a menu of some sort. In its simplest form, a menu could be a button which the player clicks with the mouse or taps. But if you’re using keyboard or gamepad controls, implementing a menu requires a little more work.

This tutorial looks at three ideas for a keyboard-controlled menu system – one in a simple grid style, one laid out in a sort of ring shape and one that functions like a scrolling list. They all have similar functionality, including a boolean to track whether the menu is open, which then determines whether or not to make the menu’s layer visible.

The menu system is designed to work with both keyboard and gamepad inputs and uses instance and global variables to track which options the player has highlighted and selected.

So, let’s look at how to set up each style of menu.


  • Order by
Want to leave a comment? Login or Register an account!
  • Thanks Laura and team for putting this together, these are good examples and well explained. Another great resource for/from the community!

  • Thank you Laura for sharing this tutorial. I was a bit in trouble a few months ago regarding analog values. I dindn't really know which values to set to get a up, right, down, and left movement detection. It took me some time to run a couple of tests and find out. Hopefully now there is a tutorial to explain that. I bookmarked it for later use/references. ✌️

  • thank you this was great!

  • nice work on this.

  • It's 2021 and this is still useful! Solid work.

  • Load more comments (5 replies)