PDA

View Full Version : DelphiX and Shadows, alphablending



hammer
04-10-2004, 05:38 PM
I need to create some shadowing for a game.
Here is the situation, we have an bitmap wich is the object a tree for example and a bitmap that represents the shadow of the tree how can i place the shadow of the tree on the correct place and not completely shadowing the background.

I think alpha blending will be it but i've never used it before.

WILL
05-10-2004, 12:38 AM
If yuo are planning on doing these things for anything that requires the speed of anything faster than a snail, I'd seriously suggest either GLXtreem or GLScene. And there are of course other means than just using components too.

Generally I find (Un)DelphiX is great for quickly throwing something together for a little 2D game/tool, but even that has it's limits and 3D is one of those things that calls out all the stops.

Traveler
07-10-2004, 12:10 PM
If you want to have shadows I wouldn't recommend using delphix. Alphablending isn't exactly delphix strongest point. I'm not sure about your game, since you haven't told much about it, but if your game requires many trees it will slowdown your game considerably.

If you want to keep speed up, and still want to have shadows, I recommend using a different package, like Omega for example.
I haven't worked much with Omega yet, but it looks a lot like DelphiX and has quite good support. I recommend giving it a try.

As for drawing the shadow itself, If you have made the image in a graphicseditor, you can make an image of the tree and an image of the shadow. You can then also decide at which coordinates you need to draw the shadow (say at 7,13 from the tree) Then in your game you first draw the shadow and then the tree.

hammer
08-10-2004, 07:03 AM
i'll try out the omega package,
i've also found on the net some asm alpha blending wich looks quote good
and has mmx optimizations. i just need to edit the code a little bit so its compilant with delphi.