delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/08/09/11:19:13

Sender: nate AT cartsys DOT com
Message-ID: <35CDB759.36D13D18@cartsys.com>
Date: Sun, 09 Aug 1998 07:51:05 -0700
From: Nate Eldredge <nate AT cartsys DOT com>
MIME-Version: 1.0
To: Einar <"eincar"@[EINAR]vip.cybercity.dk>
CC: djgpp AT delorie DOT com
Subject: Re: Text and graphics?
References: <6qhn55$omq$1 AT news DOT cybercity DOT dk> <6qk59l$qof$1 AT news DOT cybercity DOT dk>

Einar wrote:

> I can easily place a pre written text onto the screen using:
> 
> textout(bitmap *bmp,font *f,unsigned char *s,int x, y, int color);
> 
> that is provided with Allegro.
> But if I try to write a text onto the background picture using:
> 
> scanf("%s", &player1);
> 
> the game freezes.

What the hey?  `scanf' is for reading, not writing, so obviously you
can't write anything using it.  Furthermore, it's unlikely to work right
in a graphics mode; you'll have to use Allegro's features for that.

If you want to put text on the screen, try `sprintf' followed by
`textout'.
-- 

Nate Eldredge
nate AT cartsys DOT com


- Raw text -


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