Mail Archives: djgpp/2000/01/20/17:51:34
"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 -