// strings:
uint8_t gb.gui.menu( const char* title , const char** items [, uint8_t length] )
// Multilang:
uint8_t gb.gui.menu( const MultiLang* title , const MultiLang** items [, uint8_t length , uint8_t numLang] )
gb.gui.menu provides a nice graphical menu where you can pick items. It returns the index of the item that was picked by the user.
uint8_t: index of the selected entry
#include <Gamebuino-Meta.h>
const char* entries[] = {
"Pizza",
"Spaghetti",
"Noodles",
"Ice Cream",
};
void setup() {
gb.begin();
// display the menu
uint8_t entry = gb.gui.menu("Best food?", entries);
gb.display.clear();
gb.display.println("You picked:");
gb.display.print(entries[entry]);
}
void loop() {
while(!gb.update());
}