d_textbox_proc(3)

πŸ“¦ version 4.4.3.1, in fedora 43, fedora 44

πŸ’– d_textbox_proc β€” the Allegro manual, but make it cute πŸ’–

okay bestie, welcome to the Allegro game programming library, and specifically to d_textbox_proc(3) β€” the manual page for the dialog procedure that literally IS a text box object. yes, that text box. the scroll-y one. the one you're gonna be obsessed with. πŸŽ€


✨ SYNOPSIS ✨

#include <allegro.h>

int d_textbox_proc(int msg, DIALOG *d, int c);

like. look at it. three args. slay. πŸ’…


🌸 DESCRIPTION 🌸

so here's the tea: this is a text box object. iconic behaviour, no notes.

the dp field points to the text that's gonna be displayed in the box. that's the whole vibe β€” dp = your words, your moment. ✨

now, if your text is long (and it's giving "I have so much to say"), there's gonna be a vertical scrollbar on the right hand side of the object, and you can use it to scroll through the text. main character energy, scrolling through your own lore fr fr. πŸ¦‹

the default? it prints the text with word wrapping. cute, tidy, respects the words. but β€” and this is the plot twist β€” if the D_SELECTED flag is set, the text gets printed with character wrapping instead. different wrapping, different vibe. not me choosing based on a flag πŸ™ˆ

as for the fields doing quiet internal labour (we love a humble icon):

  • d1 β€” used internally to store the number of lines of text. it's keeping count. it's keeping track. it's lowkey the accountant of this whole operation. πŸ‘‘
  • d2 β€” used internally to store how far it has scrolled through the text. it's the one remembering where you left off. so real of it. πŸ’œ
heads up bestie: d1 and d2 are internal storage. that's their job. that's their whole thing. don't be weird about it. 😭

πŸ”₯ SEE ALSO πŸ”₯

go look at the example, it's literally right there, iykyk. ⭐


and that's the page!! 🫢 brought to you by Allegro, version 4.4.3 β€” this specific text box manual page was living its life as part of that release. periodt. πŸ’–βœ¨πŸŒΈ

πŸ“¦ where this page comes from