delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/08/11/23:20:13

Message-ID: <37B14F14.4EEBF047@pmail.net>
Date: Wed, 11 Aug 1999 12:23:16 +0200
From: Fred Backman <fredrick DOT backman AT pmail DOT net>
X-Mailer: Mozilla 4.6 [en] (Win98; I)
X-Accept-Language: en
MIME-Version: 1.0
To: djgpp AT delorie DOT com
Subject: Re: allegro textout
References: <7op7if$src$1 AT garnet DOT nbnet DOT nb DOT ca>
Reply-To: djgpp AT delorie DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019