Results 1 to 4 of 4

Thread: Hiding a sprite behind background?!?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2002
    Location
    Palermo, Italy
    Posts
    325

    Question Hiding a sprite behind background?!?

    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??


    Thx,

    Xmas.

  2. #2
    Addicted Member
    Join Date
    Aug 2002
    Location
    Baltimore, MD
    Posts
    230
    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.).

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2002
    Location
    Palermo, Italy
    Posts
    325
    ...
    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

  4. #4
    Addicted Member jmiller's Avatar
    Join Date
    Jul 2002
    Location
    University of Michigan
    Posts
    238
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width