|
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 |
| #define | DEFAULT_BODY_HEIGHT 66 |
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 | setDrawBody (menuMegaRenderer_t *renderer, bool drawBody) |
| Set whether or not to draw the sci-fi rectangle background body. | |
| void | setBodyHeight (menuMegaRenderer_t *renderer, int16_t height) |
| Set the height of the body between top and bottom decorated parts If the given height is negative, it will be set to the default height. | |
| 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 | drawMenuBody (uint16_t topLeftX, uint16_t topLeftY, uint8_t expansionHeight, bool flipLR, menuMegaRenderer_t *renderer) |
| Draw the menu body background. | |
| 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 |
| #define DEFAULT_BODY_HEIGHT 66 |
| 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 setDrawBody | ( | menuMegaRenderer_t * | renderer, |
| bool | drawBody ) |
Set whether or not to draw the sci-fi rectangle background body.
| renderer | The renderer. |
| drawBody | true to draw the body background, false to skip it |
| void setBodyHeight | ( | menuMegaRenderer_t * | renderer, |
| int16_t | height ) |
Set the height of the body between top and bottom decorated parts If the given height is negative, it will be set to the default height.
| renderer | The renderer to adjust the body height for |
| height | The new height. If the given value is negative, the default height will be set. |
| 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 drawMenuBody | ( | uint16_t | topLeftX, |
| uint16_t | topLeftY, | ||
| uint8_t | expansionHeight, | ||
| bool | flipLR, | ||
| menuMegaRenderer_t * | renderer ) |
Draw the menu body background.
| topLeftX | The X coordinate of the top left corner of the body |
| topLeftY | The Y coordinate of the top left corner of the body |
| expansionHeight | The y distance of filler rectangle between the top and bottom parts of the body |
| flipLR | true to flip the body horizontally |
| renderer | The renderer to draw a body with |
| 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 |