delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/01/20/17:51:34

From: Nate Eldredge <neldredge AT hmc DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Allegro - masked_blit();
Date: 20 Jan 2000 12:48:55 -0800
Organization: InterWorld Communications
Lines: 28
Message-ID: <83r9fcv58o.fsf@mercury.st.hmc.edu>
References: <867egt$dpf$1 AT barcode DOT tesco DOT net>
NNTP-Posting-Host: mercury.st.hmc.edu
X-Trace: nntp1.interworld.net 948401442 7489 134.173.45.219 (20 Jan 2000 20:50:42 GMT)
X-Complaints-To: usenet AT nntp1 DOT interworld DOT net
NNTP-Posting-Date: 20 Jan 2000 20:50:42 GMT
X-Newsreader: Gnus v5.7/Emacs 20.4
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

"Paul Bibbings" <paul DOT bibbings AT tesco DOT net> writes:

> Please could someone give me a few pointers in the use of this function. I'm
> new to Allegro and I'm not getting very far with the available docs.
>     What I'm trying to do is simple enough, but I'm stuck with how to set
> transparent pixels. My program simply draws a chessboard to the screen, then
> accesses a single bitmap showing the chess pieces (black on a white
> background). The question is, what do I need to do so that the masked_blit()
> interprets the background as transparent, hence allowing the board to be
> seen behind the pieces.
>     I've tried everything I can think of. Allegro.txt under masked_blit()
> that transparent pixels are marked by a zero in 256 color modes, or bright
> pink for truecolor data. Hi do I set the background color of the bitmap so
> that the program will interpret it as zero and skip the background pixels?
> (I've tried changing the background color to bright pink out of desperation,
> but since the function set_palette() uses the palette derived from the
> bitmap, then ALL the colours are changed from what I set them.

You need to create your bitmap such that the "background" is actually
in color 0 (whatever that corresponds to in your pallete).  Your paint
program (or whatever you use) should have a way to do this.  If not,
you probably want to find one that does.


-- 

Nate Eldredge
neldredge AT hmc DOT edu

- Raw text -


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