Is it possible to change the visual of the selected cell in a gridview?

,

By default, a selected cell is colored with white text. Can that be changed in any way? Ideally I would like some other style of indicator like thickened borders on the cell, or an arrow within the cell.

^ These were just some random ideas I was sketching before looking into what functionality was actually possible.

I tried looking around, but couldn't find anything specifically addressing this. Thank you for your time and consideration.

The playdate.ui.gridview:drawCell function takes a selected boolean parameter that is true when the drawn cell is the one currently selected. From there, it's up to you to draw it any way you want. You can view an example from my video player menu here: playorama/Source/Menu.lua at main · hteumeuleu/playorama · GitHub

self.gridview = playdate.ui.gridview.new(self.cellWidth, self.cellHeight)

function self.gridview:drawCell(section, row, column, selected, x, y, width, height)
	if selected then
		playdate.graphics.setColor(playdate.graphics.kColorWhite)
	else
		playdate.graphics.setColor(playdate.graphics.kColorBlack)
	end
end
1 Like