do_menu(3alleg4)

✨ NAME ✨

hiii bestie πŸ’– welcome to the do_menu page from the Allegro manual β€” it's giving game programming library realness ✨

  • do_menu β€” displays and animates a popup menu. Allegro game programming library.

🌸 SYNOPSIS 🌸

okay so the vibe check is: you include allegro, and then you call it like this πŸ‘‡

#include <allegro.h>

int do_menu(MENU *menu, int x, int y);

πŸ’– DESCRIPTION πŸ’–

okay so picture this: you got a popup menu and you want it to pop <em>off</em> πŸ’…. do_menu displays and animates that popup menu right at the screen coordinates you pass in with x and y. but heads up β€” if the menu does not entirely fit on the screen, those coordinates get adjusted for you, no cap. ✨

it returns the index of the menu item that was selected, or -1 if the menu was cancelled. that's the tea. πŸ«–

but wait β€” plot twist 😭: the return value <strong>cannot</strong> indicate selection from child menus. so if you want multi-level menus, you're gonna have to use the callback functions. iykyk. 🧚


πŸ¦‹ SEE ALSO πŸ¦‹

go check out these besties, they're all part of the same friend group 🫢:


k that's the whole page πŸ’– this was do_menu(3alleg4) from the Allegro manual, version 4.4.3 β€” slay, bye! ✨