Mail Archives: djgpp/1997/10/29/09:11:12
----------
> From: Mark Phillips <bigphil AT solutions DOT mb DOT ca>
> To: djgpp AT delorie DOT com
> Subject: Newbie allegro graphics question
> Date: Tuesday, October 28, 1997 11:47
>
> If I am in graphics mode (any one) and I want to write an integer to
> the screen, how do I do it? thanks in advance,
>
> mark phillips
>
To do this you must convert the integer to a string first like so:
#include <stdlib..h> (at the start of your file)
and use the itoa (ie, integer to to ascii) function like so:
itoa( my_int, dummy_string, base_conversion);
where my_int is the int you want change, dummy_string is a character buffer
long enought to hold the converted integer and base_conversion is the base
number you want the integer to convert by (ie, base ten, base 2 etc, use
base ten for normal numbers).
then call the textout function with the dummy_string.
textout(screen, font, dummy_string, x, y, colour);
J Love
- Raw text -