Mail Archives: djgpp/1999/08/11/23:20:13
As always, there's many ways to do it, but try something like the following:
char foo[32]; // Max. 32 characters
sprintf(foo, "Parrot ate a cracker!");
textout(screen, font, foo, 300, 125, color1);
Then it's up to you to put anything into foo, as long as length < 32. Another
sample:
sprintf(foo, "Parrot ate %d crackers!", ncrackers);
textout(screen, font, foo, 300, 125, color1);
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
--
Fred Backman
Lead Wizard
Binary Spells
www.binaryspells.com
- Raw text -