Request help/advice/examples for UI menus

Have just this weekend started looking at the Playdate SDK proper (though while waiting for it to become public have been doing some prototyping of a 3D dungeon crawler in Lua using Love2D):

Encounter Menu Work-in-progress

I eventually bogged down with Love2D, though, when implementing interactive menus... sure, I could cobble together something that worked, but it was a very low-level and tedious process, so I says to myself (I says) "Well, I'll hold off until the Playdate SDK becomes public, surely they'll have something much cleaner/easier!".

I try to first read (or at least, skim through) every developer doc / API / dev forum post I can when learning a new system, so I was a bit disappointed to see Designing For Playdate / UI:

Playdate doesn’t have a lot of system UI. There’s the Setup process, the Home screen, the Menu, and Settings. These are designed to be clear, readable, quick to use, and playful where appropriate. Beyond that, we’d like your games to be the star of the show.

We don’t provide many UI widgets for games to call through our APIs. Most developers like constructing their own buttons, menus, and sounds, to match their game. Some of the Playdate APIs will help with this, such as playdate.ui.gridview.

The game we're planning will wind up with all sorts of menus (both horizontal and vertical)... for interacting with shop owners, viewing/organizing inventory, etc. Some sort of menu scrolling will likely be necessary as well. Currently planning on using Lua as the implementation language.

It seems a shame to have everyone resort to rolling their own for this kind of thing. Has anyone out there come up with a generalized solution, or have advice/examples they can share, etc? I see the reference to playdate.ui.gridview as a hint, but just from looking at the API I have no clue as to how to actually use it. Not planning on using tile sets overall, we're hoping to maintain a 3D approach.

Any help/advice appreciated... thanks!

Cool game concept!

Grid view is the easy way to get this. It can do horizontal, vertical and both/grid. Most iOS interfaces are built from one type of control (tableview) and I think about gridview in the same way.

I'd encourage you to start with the gridview Example in the SDK folder. It's complicated in that it shows two grid views on screen at once - one grid, one vertical - and you can switch between them.

So it's a good exercise to pare back the example to one gridview of your choice, gain a deeper understanding, and only then begin to integrate it into your game. This is exactly what I did for my first gridview.

Before that I tried to roll my own menu and it felt like reinventing the wheel and I encountered lots of problems.

That's not to say it wouldn't be good to have more options for UI in an add on class, because it would be good. But the menus you show can be done easily using gridview.

1 Like

Blargh, as soon as I pushed 'send' I see some gridview example code to play with that I'd missed. Will poke at that now. And thanks for confirming that that's where I need to start! :grinning:

1 Like

Yes, these were just what I needed.

Thanks again!


running_gridview_sdk_example

1 Like