Swadge 2024 2.0.0
APIs to develop games for the Magfest Swadge
|
Macros | |
#define | ITEMS_PER_PAGE 5 |
#define | ITEM_MARGIN 1 |
#define | Y_SECTION_MARGIN 13 |
#define | Y_ITEM_START 55 |
#define | MAX_ITEM_TEXT_WIDTH 191 |
#define | ARROW_PERIOD_US 1000000 |
Functions | |
menuMegaRenderer_t * | initMenuMegaRenderer (font_t *titleFont, font_t *titleFontOutline, font_t *menuFont) |
Initialize a and return a menu renderer. | |
void | deinitMenuMegaRenderer (menuMegaRenderer_t *renderer) |
Deinitialize a menu renderer and free associated memory. This will not free the font passed into initMenuMegaRenderer() | |
void | recolorMenuMegaRenderer (menuMegaRenderer_t *renderer, paletteColor_t textFill, paletteColor_t textOutline, paletteColor_t c1, paletteColor_t c2, paletteColor_t c3, paletteColor_t c4, paletteColor_t c5, paletteColor_t c6, paletteColor_t c7, paletteColor_t c8, const paletteColor_t *bgColors, int32_t numBgColors) |
Recolor the Mega menu renderer. Arguments c1 through c8 should get progressively lighter. | |
void | drawMenuMega (menu_t *menu, menuMegaRenderer_t *renderer, int64_t elapsedUs) |
Draw a themed menu to the display and control the LEDs. | |
void | setMegaLedsOn (menuMegaRenderer_t *renderer, bool ledsOn) |
Set the renderer's LEDs to be on or off. | |
#define ITEMS_PER_PAGE 5 |
#define ITEM_MARGIN 1 |
#define Y_SECTION_MARGIN 13 |
#define Y_ITEM_START 55 |
#define MAX_ITEM_TEXT_WIDTH 191 |
#define ARROW_PERIOD_US 1000000 |
menuMegaRenderer_t * initMenuMegaRenderer | ( | font_t * | titleFont, |
font_t * | titleFontOutline, | ||
font_t * | menuFont ) |
Initialize a and return a menu renderer.
titleFont | The font used to draw the title, preferably RIGHTEOUS_150_FONT. If this is NULL it will be allocated by the renderer in SPIRAM. |
titleFontOutline | The outline font used to draw the title. If this is NULL it will be allocated by the renderer in SPIRAM. |
menuFont | The font used to draw this menu, preferably RODIN_EB_FONT. If this is NULL it will be allocated by the renderer in SPIRAM. |
void deinitMenuMegaRenderer | ( | menuMegaRenderer_t * | renderer | ) |
Deinitialize a menu renderer and free associated memory. This will not free the font passed into initMenuMegaRenderer()
renderer | The renderer to deinitialize. It must not be used after deinitialization. |
void recolorMenuMegaRenderer | ( | menuMegaRenderer_t * | renderer, |
paletteColor_t | textFill, | ||
paletteColor_t | textOutline, | ||
paletteColor_t | c1, | ||
paletteColor_t | c2, | ||
paletteColor_t | c3, | ||
paletteColor_t | c4, | ||
paletteColor_t | c5, | ||
paletteColor_t | c6, | ||
paletteColor_t | c7, | ||
paletteColor_t | c8, | ||
const paletteColor_t * | bgColors, | ||
int32_t | numBgColors ) |
Recolor the Mega menu renderer. Arguments c1 through c8 should get progressively lighter.
renderer | The renderer to recolor |
textFill | The color of the text fill, originally white |
textOutline | The color of the text outline, originally black |
c1 | Replacement for Darkest blue |
c2 | Replacement for Very dark blue |
c3 | Replacement for Dark blue |
c4 | Replacement for Dark moderate blue |
c5 | Replacement for Dark strong blue |
c6 | Replacement for Light strong blue |
c7 | Replacement for Pure cyan |
c8 | Replacement for Very pale cyan |
bgColors | A list of colors to cycle through in the hexagonal background. May be NULL for no change. |
numBgColors | The length of bgColors |
void drawMenuMega | ( | menu_t * | menu, |
menuMegaRenderer_t * | renderer, | ||
int64_t | elapsedUs ) |
Draw a themed menu to the display and control the LEDs.
menu | The menu to draw |
renderer | The renderer to draw with |
elapsedUs | The time elapsed since this function was last called, for LED animation |
void setMegaLedsOn | ( | menuMegaRenderer_t * | renderer, |
bool | ledsOn ) |
Set the renderer's LEDs to be on or off.
renderer | The renderer to set |
ledsOn | true to animate the LEDs, false to keep them off |