Results 1 to 2 of 2

Thread: Click a Sprite?

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2001
    Posts
    1

    Unhappy Click a Sprite?

    Ive asked this question in several newsgroups and forums and am not really finding an answer. I am simply trying to distinguish a transparent and irregular shaped blitted sprite from the drawing surface. My aim is to have a situation where if either the blitted sprite or the drawing surface are clicked then a different event can take place. For instance, if the sprite is clicked then the form caption could say "True" and if the drawing surface has been clicked it could say "False". I have found I can get this to work if either the sprite or drawing surface are just one color by using the GetPixel API call and saying e.g. "if backcolor pixel <> the sprite pixel color then form caption = whatever". But if the drawing surface and sprite are of multiple colors this routine wont work. Hope that makes sense.

  2. #2
    Lively Member
    Join Date
    May 2000
    Posts
    84
    Using the normal bitblt routine for transparancy you almost always have a black and white silouette of the shapeused for masking. Instead of testing the color of the pixel that is clicked you find out if the area clicked is in the region the sprite was drawn to. Then you check the black and white mask layer to see if the actual sprite was clicked. Black=True White=False

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