Design Philosophy
Help pages can be used to draw multiple pages of multi-line text. This is useful for drawing a help manual for a Swadge mode in a consistent manner. The pages are themed using menuMegaRenderer_t.
Usage
initHelpScreen() must be called to initialize the screen before handling buttons and drawing. deinitHelpScreen() must be called to free memory when it's no longer needed.
buttonHelp() must be called to handle button input. It will return a boolean indicating if the help screen should be exited.
drawHelp() must be called to draw the screen.
Example
{
.title = "Page 1",
.text = "This is the first page of help text! Welcome!",
},
{
.title = "Page 2",
.text = "This is the second page of help text. It probably has more details or something.",
},
};
{
}
void deinitHelpScreen(helpPageVars_t *help)
Deinitialize a help screen.
Definition helpPages.c:50
bool buttonHelp(helpPageVars_t *help, buttonEvt_t *evt)
Handle a button event on the help screen.
Definition helpPages.c:127
void drawHelp(helpPageVars_t *help, int32_t elapsedUs)
Draw the help screen.
Definition helpPages.c:61
helpPageVars_t * initHelpScreen(menu_t *bgMenu, menuMegaRenderer_t *menuRenderer, const helpPage_t *pages, int32_t numPages)
Initialize a help screen.
Definition helpPages.c:34
All the variables required for a help screen.
Definition helpPages.h:77
A help page consisting of a title and text.
Definition helpPages.h:68
#define ARRAY_SIZE(arr)
Definition macros.h:66