Swadge 2024 2.0.0
APIs to develop games for the Magfest Swadge
Loading...
Searching...
No Matches
menuSimpleRenderer.c File Reference

Macros

#define MENU_MARGIN   16
 
#define FONT_MARGIN   8
 

Functions

menuSimpleRenderer_tinitMenuSimpleRenderer (font_t *font, paletteColor_t border, paletteColor_t bg, paletteColor_t text, int32_t rows)
 Initialize a and return a menu renderer.
 
void deinitMenuSimpleRenderer (menuSimpleRenderer_t *renderer)
 Deinitialize a menu renderer and free associated memory. This will not free the font passed into initMenuSimpleRenderer()
 
void drawMenuSimple (menu_t *menu, menuSimpleRenderer_t *renderer)
 Draw a themed menu to the display and control the LEDs.
 

Macro Definition Documentation

◆ MENU_MARGIN

#define MENU_MARGIN   16

◆ FONT_MARGIN

#define FONT_MARGIN   8

Function Documentation

◆ initMenuSimpleRenderer()

menuSimpleRenderer_t * initMenuSimpleRenderer ( font_t * font,
paletteColor_t border,
paletteColor_t bg,
paletteColor_t text,
int32_t rows )

Initialize a and return a menu renderer.

Parameters
fontThe font used to draw this menu
borderThe color for the background border
bgThe color for the background
textThe color for the text
rowsThe number of rows to display
Returns
A pointer to the menu renderer. This memory is allocated and must be freed with deinitMenuSimpleRenderer()

◆ deinitMenuSimpleRenderer()

void deinitMenuSimpleRenderer ( menuSimpleRenderer_t * renderer)

Deinitialize a menu renderer and free associated memory. This will not free the font passed into initMenuSimpleRenderer()

Parameters
rendererThe renderer to deinitialize. It must not be used after deinitialization.

◆ drawMenuSimple()

void drawMenuSimple ( menu_t * menu,
menuSimpleRenderer_t * renderer )

Draw a themed menu to the display and control the LEDs.

Parameters
menuThe menu to draw
rendererThe renderer to draw with