Mail Archives: djgpp/1997/10/30/02:01:36
Mark Phillips wrote:
>
> 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
First, try to create a string containing the integer. You can use
sprintf. eg: sprintf(string,"%i",integer);
Next, use Allegro's textout function to write the string to a bitmap.
eg: textout(screen, font, string, x, y, colour);
Note that there is a variable called screen and one called font. screen
refers to the actual screen, and font refers to the default font. You
can replace screen with any bitmap in case you are using a double
buffering technique for graphics, that is write all the graphics for one
frame onto a memory bitmap then blit (copy) it in one go to the screen.
x and y are the location of the bitmap/screen to write to.
Hope that this clears it up,
Barry Rodewald.
- Raw text -