Transparency issues.

AcidBoot
02-05-2002, 02:18 AM
I am doing a RPG (I am suprised to see so many ppl doing the same here!) using a 48x48 tileset. I am having difficulty achieving transparency for creatures in a timely fashion.

My current solution is an array of image controls overlaying the map area, using .GIFs with transparent backgrounds. The problem is that VB seems to have some sort of mental problem loading non-BMP images quickly.

Combat is no problem, as it is turn based and only one individual moves at a time. In the overland view however all enemies move pretty much at once, in reaction to the player's move. It is OK with just a couple of badies, but when you have a dozen each turn can take almost a second:eek:, which is unacceptable. I'd like to get it down to ~0.1 seconds if possible.

I tried andreww's suggested method, but it was hideously slow with the qty of pixels being shifted.(over a minute:()

BitBlt seems to work OK if I preload all required images into a hidden dynamic array of picboxes, but I don't know how to do transparency with this method.

Also, can you bitblt to an image control? The image control doesn't have a .hdc property, so I can't see how.:confused:

That's it for now, I guess, though I'm sure I'll have some other questions as the game progresses.

Flyguy
02-05-2002, 02:40 AM
To do a transparent bitblit you need to create a mask of the picture to.

Have a look here (http://home7.swipnet.se/~w-71996/game.html) for a small tutorial...

AcidBoot
02-06-2002, 08:27 AM
Never mind! I have this one sorted big time.

Check out my new Post "VFast Transparency".

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum