Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Newbie- Display int?

This thread is locked; no one can reply to it. rss feed Print
Newbie- Display int?
Craig Harrison
Member #5,255
November 2004
avatar

How can I output an integer using textout_ex or textprintf_ex?

Thanks!

Thomas Fjellstrom
Member #476
June 2000
avatar

First off, this was just posted, and second, it takes the same format strings that the printf function from libc does.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

inspiredevistate
Member #7,980
November 2006

textprintf(BITMAP *bmp, FONT *fnt, x, y, COLOR, "%s", string)
/*this displayed the string "string"*/

LennyLen
Member #5,313
December 2004
avatar

Quote:

textprintf(BITMAP *bmp, FONT *fnt, x, y, COLOR, "%s", string)

Or, since he was asking about the new, non-depricated versions, and outputting integers not strings:

void textprintf_ex(BITMAP *bmp, const FONT *f, int x, int y, int color, int bg, "%d", number)

Go to: