Approach to create a menu system for the title screen

I'm starting to dig into developing a small game for the Playdate, but from what I've read, it looks like that one needs to create a lot of their own components to get things set up.

I think I'm going to try out Lua for my new project. On the main start screen, I want to be able to cycle through several buttons (Play, Credits, High Scores, Instructions), so that would likely require using the D-pad to cycle between the buttons. Is there some recommended approach on how to create the buttons and be able to highlight the "selected" button (different highlight, or some indicator icon)? Or is a lot of this just need to be created from scratch? I want to check if there is a more obvious solution or other implementations before I dive in and create everything by hand.

1 Like

You can do it any way you want, depending on the effect you want to achieve. People do it lots of different ways. I might consider a gridView (especially if you might need to scroll taller than the screen), or a variable that tracks which of several buttons is highlighted, then draw it differently in whatever way you choose. (That's what I did for Playtime—along with a timer-based blink effect.)

The SDK comes with some examples, including one for gridView. And many developers have shared useful code. This UI library may be overkill for you—or a big help:


At its simplest this would be:

data structure

  • a Lua table with one item for each button
  • a variable to keep track of the current button


  • a function to draw a single button
  • a loop to draw all of your table items as buttons


  • input handler to increase/decrease value of current button variable when down/up are pressed


  • modify draw function so it draws highlight (eg. thicker border) if the index of the button being drawn is equal to the value of the current button variable

So, you could say that - yes - you can do this stuff from scratch yourself, but it doesn't have to be very complicated.

Of course you can make it as simple or as complicated as you like. Knowing when to stop is the next challenge :slight_smile: