delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/08/11/21:55:02

Message-ID: <37B068C0.6C77@ns.sympatico.ca>
From: Klaas <klaas1 AT ns DOT sympatico DOT ca>
Organization: N/A
X-Mailer: Mozilla 3.04 (Win95; I)
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
Subject: Re: allegro textout
References: <7op7if$src$1 AT garnet DOT nbnet DOT nb DOT ca>
Lines: 32
Date: Tue, 10 Aug 1999 15:00:32 -0300
NNTP-Posting-Host: 142.177.85.69
X-Trace: sapphire.mtt.net 934308005 142.177.85.69 (Tue, 10 Aug 1999 15:00:05 ADT)
NNTP-Posting-Date: Tue, 10 Aug 1999 15:00:05 ADT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

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 -


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