Results 1 to 9 of 9

Thread: Alpha blended sprites?

  1. #1

    Alpha blended sprites?

    Hi everyone.
    I am a newbie DelphiX programmer and i started working on my game.
    I made a road for the background, and i want to make a water sprite on the road, but it just looks silly being only blue, so I would like to make it kind of transparent (about 60%?)

    Is there any way to do this?

  2. #2

    Alpha blended sprites?

    Use the DrawAlpha or DrawRotateAlpha methods to draw the image, passing in a value of between 0 and 255 for the Alpha.
    [size=10px][ Join us in #pgd on irc.freenode.net ] [ Sign the Petition for a Software Patent Free Europe ][/size]

  3. #3

    Alpha blended sprites?

    Thank you, I'll try that.

  4. #4

    Alpha blended sprites?

    I did it, but it is very VERY slow.
    I tried what I could think of (not much) to speed it up, but still fps goes way down when alphablending. :cry: :evil:
    Is there any way to speed it up?

  5. #5

    Alpha blended sprites?

    The trouble is, DelphiX does the alphablending (and rotation) in software, since DirectDraw does not support this in hardware.

    You could try creating a combined road/water image initially, then just redrawing that using the normal draw method, but this would only be of use if the image was fairly static.
    [size=10px][ Join us in #pgd on irc.freenode.net ] [ Sign the Petition for a Software Patent Free Europe ][/size]

  6. #6

    Alpha blended sprites?

    Thanks for suggestion, but it's not static, so I made something else instead of water. Now I would like to make fadein/out effect between levels for my game. I tried AlphaBlending and ofcourse result was very slow. So the question is: How to make fadein/out effect in Delphix?

  7. #7

    Alpha blended sprites?

    Apart from alpha blending, you can use gamma ramps or palette animation.
    Palette animation is only available if you are using 8-bit or less colour, but there is a sample in the DelphiX package showing how to do this.
    Gamma ramps are rather more complicated, though Alimonster wrote an article about how to do it in straight DirectDraw (here).
    [size=10px][ Join us in #pgd on irc.freenode.net ] [ Sign the Petition for a Software Patent Free Europe ][/size]

  8. #8

    Alpha blended sprites?

    Thank you for your help.

  9. #9

    Alpha blended sprites?

    Try PowerDraw (http://turbo.gamedev.net/powerdraw.asp). PowerDraw can draw TGA images, which support transparency, and does it in hardware, because it uses DirectX 9.

Bookmarks

Posting Permissions

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