Mail Archives: djgpp/1998/04/22/12:01:32
From: | Michal Mertl <xmerm05 AT manes DOT vse DOT cz>
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | Re: Background colour for text using Allegro
|
Date: | Wed, 22 Apr 1998 17:41:47 +0200
|
Organization: | Prague University of Economics
|
Lines: | 30
|
Message-ID: | <Pine.ULT.3.95.980422172717.6504A-100000@manes.vse.cz>
|
References: | <6h50av$f3s AT news DOT network DOT com>
|
NNTP-Posting-Host: | manes.vse.cz
|
Mime-Version: | 1.0
|
In-Reply-To: | <6h50av$f3s@news.network.com>
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
On 16 Apr 1998, Mike Collins wrote:
> I am trying to use Allegro to write a simple typing tutor.
>
> Initially, the screen is white with black text on it that has to be
> read and typed. To show at what speed a line should be typed, a
> coloured bar moves along the text line making a background for the
> text, changing the original white background to, for example,
> green. I would like to do this without rewriting the text, but
> everything I have tried simply hides the text under my colour bar.
>
Do you mean to draw the text only once? If so you can't do that with any
Allegro function.
If the bar moves in jumps long as the character width (e.g. 8 for fixed width
font (the default one)) you can redraw always only two characters, the one you
are moving the bar from with white background and the one you are moving to
with green background. You set the background of characters with
text_mode(background_color).
If the bar moves by say 1 pixel it would be a bit more difficult, you would
first have to draw backgrounds (first bigger white rectangle and than smaller
green), call text_mode(-1) to draw the characters without affecting the
background.
HTH
Michal "MiMe" Mertl
xmerm05 AT vse DOT cz
- Raw text -