delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/10/29/08:37:26

From: Ryan Blazecka <eblazecka AT bc DOT sympatico DOT ca>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Newbie allegro graphics question
Date: Mon, 27 Oct 1997 17:32:46 -0800
Organization: BCTEL Advanced Communications
Lines: 20
Message-ID: <345540BE.7518@bc.sympatico.ca>
References: <6335en$1ed$1 AT postern DOT mbnet DOT mb DOT ca>
Reply-To: eblazecka AT bc DOT sympatico DOT ca
NNTP-Posting-Host: srry01m03-175.bctel.ca
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Mark Phillips wrote:
> 
> If I am in graphics mode (any one) and I want to write an integer to
> the screen, how do I do it? thanks in advance,

write the number to a string using sprintf:

char tempstr[12];
sprintf(tempstr, "%d", integer_to_print);

then use textout to put the string on the screen:

textout(screen, font, tempstr, x, y, color);

The new WIP has functions specially designed to handle this situation,
but I don't have the syntax handy.

-- 
[  Ryan Blazecka  --  http://www.deninc.com/~corrosion/  ]
[ _corrosion_ AT geocities DOT com OR eblazecka AT bc DOT sympatico DOT ca ]

- Raw text -


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