Blit/Draw_sprite: Transparency
SkaxCo

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
SkaxCo

Thanks!

Thread #590375. Printed from Allegro.cc