Sprite ?

This is a discussion on Sprite ? within the Game Programming forums, part of the General Programming Boards category; Allright, so I have my sprite and its on a black(but can be white) background. Now I place my sprite ...

  1. #1
    Registered User
    Join Date
    May 2002
    Posts
    317

    Sprite ?

    Allright, so I have my sprite and its on a black(but can be white) background. Now I place my sprite on my scrolling background and , BAM, look a black rectangle outlining my ship with the stars going through my ship, or with just black behind my ship. So, to get to the point, how can one merge the sprite image with the background so they blend together?

  2. #2
    Has a Masters in B.S.
    Join Date
    Aug 2001
    Posts
    2,267
    alpha mapping.
    ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.

  3. #3
    Registered User
    Join Date
    May 2002
    Posts
    317
    Isn't that with DirectX?

  4. #4
    Registered User
    Join Date
    Apr 2002
    Posts
    1,571
    Do you mean you want the background color of the sprite to be transparent? This is known as color key transparency. I don't know what you are doing or working with so I can't help you too much. If you are using DirectX its easy though! Let me know.

  5. #5
    Has a Masters in B.S.
    Join Date
    Aug 2001
    Posts
    2,267
    >Isn't that with DirectX?

    Direct-X, OpenGL, whatever... they both do it.

    how it works(generally, non tehnical):

    method one:

    a color or several colors is chosen, and if a pixel matches that color it is not drawn, or is blended to the specified alpha(transparency level).

    method two:

    every pixel has its own alpha value(transparency level) and that is used to blend it with the background pixels and their alphas and so on.
    ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.

  6. #6
    Registered User
    Join Date
    May 2002
    Posts
    317
    Thanx for the info, I finally got it after looking around on msdn. I am starting just a general space game, hence the previous posts on scrolling background and screen capture(for the sprite). I got all that stuff done now, so now its just continuing with the code. Thanx for all the help.

  7. #7
    Registered User
    Join Date
    Sep 2001
    Posts
    305
    what im thinking is that youve used black in your sprite..... make the transparent color something that you dont use. 256,256,256 is the "magic pink".

  8. #8
    Visionary Philosopher Sayeh's Avatar
    Join Date
    Aug 2002
    Posts
    212
    256,256,256 is the "magic pink".
    Uh, actually, the highest in this kind of RGB configuration is 255,255,255. A '256' would require 9 bits.
    It is not the spoon that bends, it is you who bends around the spoon.

  9. #9
    Unregistered
    Guest
    And the "magic pink" is 255, 0, 255

  10. #10
    Registered User JoshG's Avatar
    Join Date
    Mar 2002
    Posts
    326
    Heh, I was just fixing to say that

  11. #11
    Driveway
    Guest

    Talking

    Anyways if he was going at 255, 255, 255, that would be white...

  12. #12
    . Driveway's Avatar
    Join Date
    May 2002
    Posts
    469
    err... my account wasn't working, but now it is.... Notice how I was a guest even though there was a regiseted Driveway

  13. #13
    Rambling Man
    Join Date
    Jan 2002
    Posts
    1,050
    "magic" pink is 255, 0, 255 so driveway is right that 255, 255, 255 would be white.

  14. #14
    Registered User Kirdra's Avatar
    Join Date
    Aug 2002
    Posts
    105
    Animate the black background of your sprite to work parelle to the background. (This would probably take a long time to figure out how to work so maybe you should not try it lol)

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. DirectX 9 sprite issue
    By maxthecat in forum Game Programming
    Replies: 9
    Last Post: 05-18-2006, 05:04 AM
  2. SDL question (long)
    By yahn in forum C++ Programming
    Replies: 0
    Last Post: 04-16-2006, 09:46 PM
  3. GDI sprite (Win32 API)
    By fiff in forum Game Programming
    Replies: 4
    Last Post: 06-24-2005, 10:09 AM
  4. GDI sprite (Win32 API)
    By fiff in forum C++ Programming
    Replies: 3
    Last Post: 06-22-2005, 04:08 PM
  5. Replies: 3
    Last Post: 05-12-2003, 06:49 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21