Mail Archives: djgpp/1999/08/11/22:34:24
Klaas <klaas1 AT ns DOT sympatico DOT ca> wrote in message
news:37B068C0 DOT 6C77 AT ns DOT sympatico DOT ca...
> guthrie wrote:
> >
> > how can I , if even possible , print a string or char array out to the
> > screen using the textout or textout_centre allegro functions?
> >
> > so far i have only used the functions as follows ::
> >
> > textout (screen, font , " Rotate Left " , 300 , 125, color1);
> >
> > using the string like that
> >
> > but what if i want to use a variable in place of the " Rotate Left "
part
> > ?
> >
> > do i have to use char[] or string ?.... i haven't been able to get
string
> > to work at all and haven't tried the char array yet.
> >
> > Is this possible or do i have to make a new toextout function?
> >
> > Thanks
> >
> > Tony
>
> In the latest versions of allegro, you can use printf-style formatting.
>
> So,
> text_printf(bmp,font,x,y,color,format string,variables);
>
> Putting any char[] or char in in the format string spot should yield
> your intended result.
>
> -Mike
- Raw text -