Click to See Complete Forum and Search --> : Hiding a sprite behind background?!?
Xmas79
Nov 5th, 2002, 08:20 AM
How can I hide my sprites behind some backgrounds???
For example think about a man: he's walking... ta, ta, ta... there is a wall... go behind and go on walking... ta ta ta.... when wall finished go foreground ... and so on...
Any ideas??:confused: :confused: :confused:
Thx,
Xmas.
Machaira
Nov 5th, 2002, 08:32 AM
This is a matter of the order in which you draw things. Usually you'll have layers that represent different parts of the game - the first layer would be the ground, the next layer could be the sprites, the last layer could be objects which would obscure the sprites (buildings, trees, etc.).
Xmas79
Nov 5th, 2002, 08:40 AM
...
A question: How do you define a sprite?
I'm using a user control donwloaded from here, it allows me to make a picturebox transparent. My sprites are done in this way... So if I draw a line in the form it doesn't matter... My sprite will rest on foreground...
Do i have to change my mind??
Thx
jmiller
Nov 5th, 2002, 09:02 AM
you know i would just create a bitmap using the api, allapi.net is good for that information. then just draw the bitmap using bitblt (again, allapi.net). When you want to make it go behind, just draw the background first. i can give you an example, if your interested.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.