do_menu(3)
π do_menu β NAME π
do_menu β displays and animates a popup menu. It's part of the Allegro game programming library, bestie. π¦
β¨ SYNOPSIS β¨
#include <allegro.h>
int do_menu(MENU *menu, int x, int y);
πΈ DESCRIPTION πΈ
Okay so listen. do_menu displays and animates a popup menu right at the screen coordinates you hand it β that's your x and your y, bestie. π
Lowkey important: those coordinates will be adjusted if the menu doesn't entirely fit on the screen. The function is not gonna let your menu hang off the edge, she's got main character energy and she fits herself in. π
Then she returns the index of the menu item that was selected β or -1 if the menu was cancelled. Like, if your user noped out, you get -1. Periodt. π
π¨ Real talk though: the return value cannot indicate selection from child menus. So if you want multi-level menus, you are going to have to use the callback functions. No cap, there is no other way. π
π«Ά SEE ALSO π«Ά
Go read those too, iykyk. π
And that's the whole vibe, angel β this was the do_menu(3) page out of the Allegro manual, brought to you by Allegro version 4.4.3. Slay, go build a menu. πβ¨π
π¦ where this page comes from
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms