Creating menus for keyboard or gamepad input

16

Index

Attached Files

The following files have been attached to this tutorial:

.c3p

simplegridmenu.c3p

Download now 125.82 KB
.c3p
.c3p

Stats

8,812 visits, 20,255 views

Tools

Translations

This tutorial hasn't been translated.

License

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.

Published on 28 Apr, 2020. Last updated 12 May, 2020

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.

  • 9 Comments

  • Order by
Want to leave a comment? Login or Register an account!
  • thxs for message

  • 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. ✌️

  • Thanks Laura and team for putting this together, these are good examples and well explained. Another great resource for/from the community!

  • thank you this was great!

  • nice work on this.

  • Load more comments (4 replies)