Using transparent PNG for game development?

Spamzilla 41 Reputation points
2023-02-03T17:52:22.6+00:00

I'm thinking of developing a game using transparent PNGs but I have a couple issues:

  1. I can only get things to animate while they are moving.
  2. The images cut into each other leaving empty spots.
.NET
.NET
Microsoft Technologies based on the .NET software framework.
861 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
7,500 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Castorix31 68,491 Reputation points
    2023-02-04T02:15:38.6066667+00:00

    For games, use Direct2D (or D3D) for Hardware acceleration

    For 2D, use ID2D1SpriteBatch which allows to use Sprite sheets, the transparentcy being automatically managed by Direct2D

    A test for simple animations with 2 Sprites sheets (bird and butterfly) in C# with P/Invoke (Win2D can also be used), with WinUI 3 (same code as with Winforms)

    (animations are smoother than on the GIF...)

    Direct2D_CSharp