Mail Archives: djgpp/1998/08/09/11:19:13
Einar wrote:
> I can easily place a pre written text onto the screen using:
>
> textout(bitmap *bmp,font *f,unsigned char *s,int x, y, int color);
>
> that is provided with Allegro.
> But if I try to write a text onto the background picture using:
>
> scanf("%s", &player1);
>
> the game freezes.
What the hey? `scanf' is for reading, not writing, so obviously you
can't write anything using it. Furthermore, it's unlikely to work right
in a graphics mode; you'll have to use Allegro's features for that.
If you want to put text on the screen, try `sprintf' followed by
`textout'.
--
Nate Eldredge
nate AT cartsys DOT com
- Raw text -