Masks for the Battle...

Computer_Guy
02-20-2002, 05:02 PM
Okay, now I'm trying to put a background in my game, however, before I do that, I want to make sure I can get my masks for the hero/enemy to work.

I read on another thread that if you use get/set pixel for large pictures, and mine are somewhat large, it will cause lag, and I also read that using another picture with an already made mask will perform the same results.

So I tried to make a mask for the enemy character, and saved it. Then I load it into a picturebox for the enemy when the fight begins. However, when I try to use the mask, it doesn't mask at all. Here is my code...


BitBlt PicEnemy.hdc, 0, 0, 98, 106, PicEMask.hdc, X2, 0, vbSrcAnd
BitBlt PicEnemy.hdc, 0, 0, 98, 106, PicESample.hdc, X2, 0, vbSrcPaint
PicEnemy.Refresh
PicEMask.Refresh
PicESample.Refresh


Now, I have all three picture boxes (The breathing, the mask, and the actual enemy) all set with autoredraw, and declare them to refresh, so I don't think that poses a problem. I also tried using VBSRCINVERT instead of VBSRCPAINT, and the white background of the picturebox turned black, but it still didn't mask.

I have posted the game below here, just in case anyone wants to take a look at it. BTW, the background in the battle is supposed to be red, just to see if the mask is working.

If anyone sees the problem, or can suggest me in the right direction, thanks
Ed

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum