chrisdill / raylib-cs

C# bindings for raylib, a simple and easy-to-use library to learn videogames programming
http://www.raylib.com/
zlib License
779 stars 68 forks source link

raylib drawline & alpha #225

Closed guillaC closed 7 months ago

guillaC commented 7 months ago

Issue description, screen & code

Since the upgrade to version 6, the alpha value of colors is no longer considered.

exemple (alpha = 15) :

static void ApplyScanlineEffect(int screenWidth, int screenHeight, int scanlineHeight)
    {
        Raylib.BeginBlendMode(BlendMode.AddColors);
        for (int y = 0; y < screenHeight; y += scanlineHeight * 2)
        {
            Raylib.DrawLine(0, y, screenWidth, y, new Color(128, 128, 128, 15));
        }
        Raylib.EndBlendMode();
    }

result :

image

Environment

Win 10, RaylibCS 6

Veslo5 commented 7 months ago

I've tested blending functions on older projects (running on 4.5.0.2) and it works same as 6.0.0 version I do not know what is your desired result, but shouldn't you use Alpha blending?

With Alpha blending and line with new Color(128, 128, 128, 128): obrazek

guillaC commented 7 months ago

I chose the wrong blend mode; we can close the ticket, the mistake is on my part ;)