Swadge 2024 2.0.0
APIs to develop games for the Magfest Swadge
|
Macros | |
#define | ITEMS_PER_PAGE 5 |
#define | PARALLELOGRAM_X_OFFSET 13 |
#define | PARALLELOGRAM_HEIGHT 25 |
#define | PARALLELOGRAM_WIDTH 229 |
#define | ROW_MARGIN 8 |
#define | DROP_SHADOW_OFFSET (ROW_MARGIN / 2) |
#define | ARROW_MARGIN 4 |
#define | ARROW_WIDTH 2 |
#define | UP_ARROW_HEIGHT 10 |
#define | UP_ARROW_MARGIN 2 |
#define | ORBIT_RING_RADIUS_1 26 |
#define | ORBIT_RING_RADIUS_2 18 |
#define | RING_STROKE_THICKNESS 8 |
#define | MIN_RING_RADIUS 64 |
#define | MAX_RING_RADIUS 114 |
Functions | |
menuManiaRenderer_t * | initMenuManiaRenderer (font_t *titleFont, font_t *titleFontOutline, font_t *menuFont) |
Initialize a and return a menu renderer. | |
void | deinitMenuManiaRenderer (menuManiaRenderer_t *renderer) |
Deinitialize a menu renderer and free associated memory. This will not free the font passed into initMenuManiaRenderer() | |
void | drawMenuMania (menu_t *menu, menuManiaRenderer_t *renderer, int64_t elapsedUs) |
Draw a themed menu to the display and control the LEDs. | |
void | setManiaLedsOn (menuManiaRenderer_t *renderer, bool ledsOn) |
Set the renderer's LEDs to be on or off. | |
void | recolorMenuManiaRenderer (menuManiaRenderer_t *renderer, paletteColor_t titleBgColor, paletteColor_t titleTextColor, paletteColor_t textOutlineColor, paletteColor_t bgColor, paletteColor_t outerRingColor, paletteColor_t innerRingColor, paletteColor_t rowColor, paletteColor_t rowTextColor, const paletteColor_t *shadowColors, int32_t shadowColorsLen, led_t baseLedColor) |
Recolor a menu renderer. | |
#define ITEMS_PER_PAGE 5 |
#define PARALLELOGRAM_X_OFFSET 13 |
#define PARALLELOGRAM_HEIGHT 25 |
#define PARALLELOGRAM_WIDTH 229 |
#define ROW_MARGIN 8 |
#define DROP_SHADOW_OFFSET (ROW_MARGIN / 2) |
#define ARROW_MARGIN 4 |
#define ARROW_WIDTH 2 |
#define UP_ARROW_HEIGHT 10 |
#define UP_ARROW_MARGIN 2 |
#define ORBIT_RING_RADIUS_1 26 |
#define ORBIT_RING_RADIUS_2 18 |
#define RING_STROKE_THICKNESS 8 |
#define MIN_RING_RADIUS 64 |
#define MAX_RING_RADIUS 114 |
menuManiaRenderer_t * initMenuManiaRenderer | ( | 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 deinitMenuManiaRenderer | ( | menuManiaRenderer_t * | renderer | ) |
Deinitialize a menu renderer and free associated memory. This will not free the font passed into initMenuManiaRenderer()
renderer | The renderer to deinitialize. It must not be used after deinitialization. |
void drawMenuMania | ( | menu_t * | menu, |
menuManiaRenderer_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 setManiaLedsOn | ( | menuManiaRenderer_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 |
void recolorMenuManiaRenderer | ( | menuManiaRenderer_t * | renderer, |
paletteColor_t | titleBgColor, | ||
paletteColor_t | titleTextColor, | ||
paletteColor_t | textOutlineColor, | ||
paletteColor_t | bgColor, | ||
paletteColor_t | outerRingColor, | ||
paletteColor_t | innerRingColor, | ||
paletteColor_t | rowColor, | ||
paletteColor_t | rowTextColor, | ||
const paletteColor_t * | shadowColors, | ||
int32_t | shadowColorsLen, | ||
led_t | baseLedColor ) |
Recolor a menu renderer.
renderer | The menu renderer to recolor |
titleBgColor | The color of the title background |
titleTextColor | The color of the title text |
textOutlineColor | The color of the title text outline |
bgColor | The color of the screen background |
outerRingColor | The color of the outer rotating ring |
innerRingColor | The color of the inner rotating ring |
rowColor | The color of the row background |
rowTextColor | The color of the row text |
shadowColors | The colors cycled through as the selected shadow |
shadowColorsLen | The number of selected shadow colors to cycle through |
baseLedColor | The color of the LED illumination |