Clay now has support for the playdate!

Hey, I just wanted to let everyone know that Clay (a UI layout library for C) now has a playdate console renderer! My pull request adding it + an example was merged yesterday: [Renderers/Playdate] Playdate console example by mattahj · Pull Request #404 · nicbarker/clay · GitHub

If you have not heard of Clay before, the author has made a really great introduction video which explains everything: https://www.youtube.com/watch?v=DYWTw19_8r4

Any improvements to the renderer are welcome as well, I'm not really an expert with the playdate - I just wanted to get things working as a first step. It would be cool to add something like converting clay colours to dithering patterns + adding some helpers for setting the focused UI element (for scrolling and etc) since clay kind assumes that there is a pointer device :sweat_smile:

8 Likes

This looks great! I'm not far from needing to implement some UX in my C game, I'll give this a look.

I was planning on making my own version of this!

Such cool work, thanks!

Last time a friend tried out writing a clay renderer for playdate they found the baseline memory usage was incredibly high, using about half of the available heap - I think because Clay_MinMemorySize is somewhere in the megabytes. Have you found this too? Or did you manage to work around it?

Hey, yeah I had the same issue - it's because the default maxElementCount in Clay is something like 8000 elements. It turns out that you can change it but the api for that is a bit weird, check the answer to the issue about it: Ability to override Clay__defaultMaxElementCount when querying min memory size (Clay_MinMemorySize())? · Issue #415 · nicbarker/clay · GitHub

Basically you can just set the max element count to something smaller

1 Like