Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Blit/Draw_sprite: Transparency

This thread is locked; no one can reply to it. rss feed Print
Blit/Draw_sprite: Transparency
SkaxCo
Member #8,323
February 2007

Can you draw transparency with blit? Because I could only find out drawing transparency with draw_sprite(), and that draws full bitmaps. That makes it a nuisance to seperate the files, so I was trying to make a function to turn a large BITMAP into an array of bitmaps. It doesn't work, with a lot of errors. Here it is (all different versions):

BITMAP * split_bitmap(BITMAP *splitting, int frames, int width, int height){
  BITMAP *split_one[frames];
  for(int i = 0; i < frames; i++){
    split_one<i> = create_bitmap(width, height);
    blit(splitting, split_one<i>, i*width, 0, 0, 0, width, height);
  }
  return split_one;
}

BITMAP *[] split_bitmap(BITMAP *splitting, int frames, int width, int height){
  BITMAP *split_one[frames];
  for(int i = 0; i < frames; i++){
    split_one<i> = create_bitmap(width, height);
    blit(splitting, split_one<i>, i*width, 0, 0, 0, width, height);
  }
  return split_one;
}

BITMAP split_bitmap(BITMAP *splitting, int frames, int width, int height){
  BITMAP *split_one[frames];
  for(int i = 0; i < frames; i++){
    split_one<i> = create_bitmap(width, height);
    blit(splitting, split_one<i>, i*width, 0, 0, 0, width, height);
  }
  return split_one;
}

And something that would make my problem go away...can you draw transparency with blit? But if not, I would appreciate any help with my function.

gnolam
Member #2,030
March 2002
avatar

--
Move to the Democratic People's Republic of Vivendi Universal (formerly known as Sweden) - officially democracy- and privacy-free since 2008-06-18!

SkaxCo
Member #8,323
February 2007

Thanks!

Go to: