Hi there, could anyone post the code to make a drop shadow effect of an image or sprite please?
Thanks in advance
Code for Drop shadow effect?
shadows for dummies:
1) draw your sprites as hardware accelerated rectangles
2) first draw the shadow at x+displace, y+displace being x,y your sprite position and displace a const to adjust: draw your shadow drawing the sprite specifying black/half transparent as each vertex's color
3) draw your sprite at x,y
Considerations: if you need a basilar 2d environment then disable z-buffer...BUT z-buffer can give you layers organization _for free_. If you wasn't speaking of 2d shadows but of 3d ones, then you have a looooong way to walk. If so, start learning algorithms, not code: A nice place to learn this kind of algorithms is www.delphi3d.net (quite out of date, but full of interesting and easy to understand articles)
1) draw your sprites as hardware accelerated rectangles
2) first draw the shadow at x+displace, y+displace being x,y your sprite position and displace a const to adjust: draw your shadow drawing the sprite specifying black/half transparent as each vertex's color
3) draw your sprite at x,y
Considerations: if you need a basilar 2d environment then disable z-buffer...BUT z-buffer can give you layers organization _for free_. If you wasn't speaking of 2d shadows but of 3d ones, then you have a looooong way to walk. If so, start learning algorithms, not code: A nice place to learn this kind of algorithms is www.delphi3d.net (quite out of date, but full of interesting and easy to understand articles)